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

Add log endpoint #68

Open
kueda opened this issue Jan 13, 2023 · 0 comments
Open

Add log endpoint #68

kueda opened this issue Jan 13, 2023 · 0 comments

Comments

@kueda
Copy link
Member

kueda commented Jan 13, 2023

Add support for POST /v1/log, probably something like

inatjs.log( {
  error_type: "TypeError",
  error_message: "Cannot read property 'prefers_scientific_name_first' of null",
  backtrace: "some\nlong\ntrace"
} );

If you want to get really fancy, it would probably help it accepted a JavaScript Error object and populated the values from that.

Another possible feature would be to support GET /v1/log, though we might need to distinguish error logging from this kind of status logging, like

# Requests GET api.inaturalist.org/v1/log?foo=bar
inatjs.log( { foo: "bar" } )

# Requests POST api.inaturalist.org/v1/log
inatjs.logError( someErrorObject );

Context: I think this would be useful for using our own infrastructure for logging and error reporting from JS client apps. We could certainly use it in our React frontend on the web, but also in the React Native app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant