Closed timclark-bgch closed 5 years ago
is the section of code that needs modification.
Wow, this must have been a nasty bug to figure out. Thanks for the issue report - I agree with your proposed fix.
Do you want me to create a pull request for you? I can have one ready sometime today.
That would be great, yes.
I'm running into this also
I am testing my server with invalid auth credentials through an AWS API Gateway.
The API Gateway returns 403 with the incorrect credentials with this JSON.
{"message":"Signature expired: 19700101T000000Z is now earlier than 20190612T110154Z (20190612T110654Z - 5 min.)"}
This results in the twirp client returning an empty twirp.Error.
This is because that JSON will unmarshal correctly into a twerrJSON struct with empty fields.
I suspect that better checking of the JSON is required in this fragment of generated code:
For example:
after that block would provide the behaviour that I would expect of mapping the http response to the correct twirp error.