Skip to content

Exceptions

FileManagerError

Base exception for all file manager errors.

from yapfm.exceptions import FileManagerError

LoadFileError

Raised when there's an error loading a file.

from yapfm.exceptions import LoadFileError

Example:

try:
    fm.load()
except LoadFileError as e:
    print(f"Failed to load file: {e}")

FileWriteError

Raised when there's an error writing to a file.

from yapfm.exceptions import FileWriteError

Example:

try:
    fm.save()
except FileWriteError as e:
    print(f"Failed to save file: {e}")

StrategyError

Raised when there's an error with file strategies.

from yapfm.exceptions import StrategyError

Example:

try:
    fm = YAPFileManager("file.xyz")
except StrategyError as e:
    print(f"Strategy error: {e}")