-
Notifications
You must be signed in to change notification settings - Fork 1
[FEATURE] - API Specific Error Codes #28
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
What's the problem this feature will solve?
The APIException class takes in both a status_code value and a code value (changed to error_code in #27 )
The error code is intended to be populated with API Specific error codes so it is clear to users what went wrong in the backend. As of right now this value is populated with the same value as the status code throughout the app. This does nothing to clarify the backend error.
Describe the solution you'd like
We should add an IntEnum containing API specific error codes that can be used throughout the backend.
For example:
from enum import IntEnum
class AppErrorCode(IntEnum):
DUPLICATE_KEY_NAME = 1001
KEY_ALREADY_INACTIVE = 1002
DUPLICATE_PV_NAME = 1003Additional context
This could be useful for the front end too. The error code would allow for more specific communication between the 2 pieces.
Also can allow users to find out what went wrong with their requests easier.
All around very beneficial. Few downsides.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested