Skip to content

Commit

Permalink
feat(st-storage): add ST Storage API endpoints (#1697)
Browse files Browse the repository at this point in the history
feat(st-storage): add ST Storage API endpoints (#1697)
  • Loading branch information
TLAIDI authored Aug 23, 2023
1 parent f533fdc commit 5091be8
Show file tree
Hide file tree
Showing 15 changed files with 2,151 additions and 108 deletions.
35 changes: 35 additions & 0 deletions antarest/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,41 @@ class ShouldNotHappenException(Exception):
pass


class STStorageFieldsNotFoundError(HTTPException):
"""Fields of the short-term storage are not found"""

def __init__(self, storage_id: str) -> None:
detail = f"Fields of storage '{storage_id}' not found"
super().__init__(HTTPStatus.NOT_FOUND, detail)

def __str__(self) -> str:
return self.detail


class STStorageMatrixNotFoundError(HTTPException):
"""Matrix of the short-term storage is not found"""

def __init__(
self, study_id: str, area_id: str, storage_id: str, ts_name: str
) -> None:
detail = f"Time series '{ts_name}' of storage '{storage_id}' not found"
super().__init__(HTTPStatus.NOT_FOUND, detail)

def __str__(self) -> str:
return self.detail


class STStorageConfigNotFoundError(HTTPException):
"""Configuration for short-term storage is not found"""

def __init__(self, study_id: str, area_id: str) -> None:
detail = f"The short-term storage configuration of area '{area_id}' not found:"
super().__init__(HTTPStatus.NOT_FOUND, detail)

def __str__(self) -> str:
return self.detail


class UnknownModuleError(Exception):
def __init__(self, message: str) -> None:
super(UnknownModuleError, self).__init__(message)
Expand Down
Loading

0 comments on commit 5091be8

Please sign in to comment.