You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when we raise a CustomException we manually write a "reason" in the response. This is not ideal as these are in English whereas localisation should occur on the clients of the consumer API (patient and clinical apps). As such, we should ideally return a set of pre-defined keys that clients can use to lookup appropriate messages to send to users, for example, INVALID_TOKEN.
I suggest that we add an enum (named ResponseErrors) to errors.py and modify CustomException so that it holds a list of ResponseErrors.
Currently, when we raise a CustomException we manually write a "reason" in the response. This is not ideal as these are in English whereas localisation should occur on the clients of the consumer API (patient and clinical apps). As such, we should ideally return a set of pre-defined keys that clients can use to lookup appropriate messages to send to users, for example,
INVALID_TOKEN
.I suggest that we add an enum (named
ResponseErrors
) toerrors.py
and modify CustomException so that it holds a list ofResponseErrors
.As an example, the inventory service would change from:
to:
The text was updated successfully, but these errors were encountered: