Errors
The status codes and messages OpenLogger answers with, and what to do.
When a request fails, OpenLogger answers with a status code and, in most cases, a JSON array that describes the problem.
Status codes
| Status | Body | Cause | What to do |
|---|---|---|---|
400 | [{"name":"app","error":"The field \"app\" is invalid","path":"app","prefix":"app"}] | app is missing or empty, or the body is not valid JSON. | Send app and check the content-type header. |
401 | An HTML error page | The token is missing or wrong, an API token was used on /api/, or your address is blocked. | Check the token. See below. |
404 | An HTML error page | The schema in an admin request is unknown. | Check the name, for example logs. |
A 200 answer does not mean every value was kept as sent: long values are cut, and unknown types become info. See Send a log.
Blocked after wrong tokens
After six requests with a wrong or missing token, OpenLogger answers 401 to every request from the same IP address, also with a valid token, for up to 15 minutes. This includes the admin interface. Restarting OpenLogger lifts the block.
Fix the token in your app, then wait or restart OpenLogger.
Check a response in your code
A wrong token answers with HTML, not JSON. Read the status code first and parse the body as JSON only when you expect it. See Send from Node.js.