-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Baptiste O'Jeanson
committed
Aug 1, 2023
1 parent
e2663fe
commit 372c247
Showing
12 changed files
with
190 additions
and
113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
toto | ||
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
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
19 changes: 19 additions & 0 deletions
19
edge_orchestrator/edge_orchestrator/application/no_active_configuration_exception.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,19 @@ | ||
from fastapi import Request | ||
from fastapi.responses import JSONResponse | ||
|
||
|
||
class NoActiveConfigurationException(Exception): | ||
def __init__(self, name: str): | ||
self.name = name | ||
|
||
|
||
async def no_active_configuration_exception_handler( | ||
request: Request, exc: NoActiveConfigurationException | ||
): | ||
return JSONResponse( | ||
status_code=403, | ||
content={ | ||
"message": f"No active configuration selected: {exc.name}! " | ||
"Set the active station configuration before triggering the inspection or the upload." | ||
}, | ||
) |
Oops, something went wrong.