Total Complexity | 0 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | """Custom exceptions.""" |
||
2 | |||
3 | 1 | from abc import ABCMeta |
|
4 | |||
5 | 1 | import yaml |
|
6 | |||
7 | |||
8 | 1 | class Error(Exception, metaclass=ABCMeta): |
|
9 | """Base class for all YORM exceptions.""" |
||
10 | |||
11 | |||
12 | 1 | class DuplicateMappingError(Error, FileExistsError): |
|
13 | """The file is already in use by another mapping.""" |
||
14 | |||
15 | |||
16 | 1 | class MissingFileError(Error, FileNotFoundError): |
|
17 | """An object's file has not yet been created.""" |
||
18 | |||
19 | |||
20 | 1 | class DeletedFileError(Error, FileNotFoundError): |
|
21 | """An object's file was deleted.""" |
||
22 | |||
23 | |||
24 | 1 | class FileContentError(Error, yaml.error.YAMLError, ValueError): |
|
25 | """Text could not be parsed as valid YAML.""" |
||
26 |