hasura / hasura/codegen-assets
return upstream error code to the client
Open
- Dominant language
- TypeScript
- Stars
- 28
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
The codegen for error handling looks like this:
```
if (errors) {
return res.status(400).json(errors[0])
}
```
This doesn't send the `code` received in the `errors[0].extensions` object and only sends the message. Ideally the codegen should send back the error code as it is to the client.
The updated error handling would look like this:
```
if (errors) {
return res.status(400).json( { code: errors[0].extensions.code, message: errors[0].message } );
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.