mirror of
https://github.com/ReviveMii/revivetube
synced 2025-04-29 12:39:25 -04:00
11 lines
333 B
Python
11 lines
333 B
Python
def read_file(path):
|
|
assert isinstance(path, str), "Path must be a string"
|
|
|
|
try:
|
|
with open(path, 'r', encoding='utf-8') as file:
|
|
content = file.read()
|
|
return content
|
|
except FileNotFoundError:
|
|
return "Error: File not found."
|
|
except Exception as e:
|
|
return f"Error: {str(e)}"
|