mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 07:25:04 +02:00
Try to detect unsupported config file encoding
The encoding detection is quite rudimentary, but should detect the default windows encoding in many cases.
This commit is contained in:
parent
a99ddaa0cc
commit
a709280cbf
1 changed files with 2 additions and 0 deletions
|
|
@ -128,6 +128,8 @@ class Config:
|
|||
raise ConfigLoadError(path, "That's a directory, not a file")
|
||||
except PermissionError:
|
||||
raise ConfigLoadError(path, "Insufficient permissions")
|
||||
except UnicodeDecodeError:
|
||||
raise ConfigLoadError(path, "File is not encoded using UTF-8")
|
||||
|
||||
def dump(self, path: Optional[Path] = None) -> None:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue