All rest errors containing a error_code field will now throw a AuthRestException rather than generic BadRequestExceptions, etc.
AuthRestExceptions contain a errorCode field of the type AuthErrorCode containing all known error codes.
Two error codes have their own exceptions (but obviously inherit from AuthRestException): AuthWeakPasswordException and AuthSessionMissingException.
API errors not containing this field will throw the generic exceptions.
What kind of change does this PR introduce?
Feature (closes #616)
What is the current behavior?
You only receive the raw error code value.
What is the new behavior?
All rest errors containing a
error_code
field will now throw aAuthRestException
rather than genericBadRequestExceptions
, etc.AuthRestException
s contain aerrorCode
field of the typeAuthErrorCode
containing all known error codes. Two error codes have their own exceptions (but obviously inherit fromAuthRestException)
:AuthWeakPasswordException
andAuthSessionMissingException
. API errors not containing this field will throw the generic exceptions.