-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from lsst-sqre/tickets/DM-42994
DM-42994: Improve messages for LTD Keeper-related errors (for 0.8.3 release)
- Loading branch information
Showing
4 changed files
with
49 additions
and
7 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
"""Exceptions related to the LTD Keeper. | ||
""" | ||
"""Exceptions related to the LTD Keeper.""" | ||
|
||
__all__ = ("KeeperError",) | ||
|
||
from typing import Optional | ||
|
||
from ..exceptions import ConveyorError | ||
|
||
|
||
class KeeperError(ConveyorError): | ||
"""Error raised because of issues using the LTD Keeper API.""" | ||
|
||
def __init__( | ||
self, | ||
message: str, | ||
status_code: Optional[int] = None, | ||
body: Optional[str] = None, | ||
): | ||
if status_code is not None: | ||
message = f"(LTD status code: {status_code})\n\n{message}" | ||
if body is not None: | ||
message = f"{body}\n\n{message}" | ||
super().__init__(message) |
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