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
Is it best practice requiring importing from the package twice? Should the package even export error functionality instead of just throwing errors with messages to the developer to handle?
I've had a look at this now, and I feel like it makes more sense to define CustomError (or something else) inside NTNUI/opptak, and not export it from NTNUI/ntnui-tools. There are some places where several responses with status code 400 can be sent, e.g.:
I try to log in with wrong credentials, and get a 400 error
I try to log in with correct credentials, but I have no committee memberships, and I get a 400 error
It would be nice to have a errorCode: INVALID_CREDENTIALS and a errorCode: MISSING_COMMITTEE_MEMBERSHIP, such that the frontend can catch both and display a better message. Currently I get a "the user is not found" for both the cases.
This logic does not really have anything to do with ntnui-tools, so CustomError should be defined in NTNUI/opptak.
Is it best practice requiring importing from the package twice? Should the package even export error functionality instead of just throwing errors with messages to the developer to handle?
Originally posted by @Xtrah in #29 (comment)
The text was updated successfully, but these errors were encountered: