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 = 1003
Additional 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.
What's the problem this feature will solve?
The
APIExceptionclass takes in both astatus_codevalue and acodevalue (changed toerror_codein #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
IntEnumcontaining API specific error codes that can be used throughout the backend.For example:
Additional 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.