client side errors were not getting properly mapped to the Twirp errors and defaulting to the Unknown error
To Reproduce:
return any error from the server and client will print as unknown
Cause:
When response status is not 200, we generate an error calling TwirpServerException.from_json, to this method, we send the error code as strings like invalid_argument or permission_denied. If you check TwirpServerException's constructor, it sorta expects code to be of error.Errors instance, if not, it defaults to Errors.Unknown error.
client side errors were not getting properly mapped to the Twirp errors and defaulting to the
Unknown
errorreturn any error from the server and client will print as
unknown
When response status is not 200, we generate an error calling TwirpServerException.from_json, to this method, we send the error code as strings like
invalid_argument
orpermission_denied
. If you check TwirpServerException's constructor, it sorta expects code to be oferror.Errors
instance, if not, it defaults toErrors.Unknown
error.