Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log adapter errors #204

Closed
RodrigoAD opened this issue Dec 18, 2020 · 4 comments
Closed

Log adapter errors #204

RodrigoAD opened this issue Dec 18, 2020 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@RodrigoAD
Copy link
Member

Currently if there is some internal error, it just get notified to the client with a 500 without logging anything. Logging this would be really helpful for debugging and recognize faster possible problems in production adapters

@RodrigoAD RodrigoAD added enhancement New feature or request good first issue Good for newcomers labels Dec 18, 2020
@justinkaseman
Copy link
Collaborator

I took a glance at this while working on the log size, do you have some steps to reproduce?

For example when I run amberdata without an API key the client gets:

{"jobRunID":"1","status":"errored","statusCode":500,"error":{"name":"AdapterError","message":"Invalid value \"undefined\" for header \"x-api-key\""}}

and the node operator sees:

{"message":"Could not reach endpoint: \"Invalid value \\\"undefined\\\" for header \\\"x-api-key\\\"\"","level":"error","instanceId":"68b86ad1-c120-47f2-a004-5245a3dff690","timestamp":"2021-01-07T18:15:26.890Z"}

Giving an invalid Requester.validateResultNumber path gives the following to the client:

{"jobRunID":"1","status":"errored","statusCode":500,"error":{"name":"AdapterError","message":"Result could not be found in path"}}

and to the node operator:

{"message":"Result could not be found in path","level":"error","instanceId":"bad3f72e-ff7b-4853-896f-354e4bd03e2d","timestamp":"2021-01-07T18:26:39.447Z"}

which also seem fine to me.

@justinkaseman
Copy link
Collaborator

Following up - reproduced this while acceptance testing the Proof of Reserves composite adapter.

@RodrigoAD
Copy link
Member Author

Those errors seem that are caught by the Requester. If you introduce any error, ie a throw inside the adapter execute function, the adapter will fail without notifying anything.

@boxhock
Copy link
Contributor

boxhock commented Jan 18, 2022

This should be covered by separate stories in Shortcut now

@boxhock boxhock closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants