-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into DOG-4566-if-a-file-has-no-content-it-will-…
…not-be-uploaded
- Loading branch information
Showing
12 changed files
with
348 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
cognite/extractorutils/unstable/configuration/exceptions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from typing import List, Optional | ||
|
||
|
||
class InvalidConfigError(Exception): | ||
""" | ||
Exception thrown from ``load_yaml`` and ``load_yaml_dict`` if config file is invalid. This can be due to | ||
* Missing fields | ||
* Incompatible types | ||
* Unkown fields | ||
""" | ||
|
||
def __init__(self, message: str, details: Optional[List[str]] = None): | ||
super(InvalidConfigError, self).__init__() | ||
self.message = message | ||
self.details = details | ||
|
||
self.attempted_revision: int | None = None | ||
|
||
def __str__(self) -> str: | ||
return f"Invalid config: {self.message}" | ||
|
||
def __repr__(self) -> str: | ||
return self.__str__() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.