Docs
Docs copied to clipboard
Last thesis in error-handling guidelines isn't reproducible
The documentation section Error-handling guidelines contains the sentences https://github.com/metarhia/Docs/blob/3f3b82e5430687fa48b1b7b003a4eabe416051ae/content/en/LAYERS.md?plain=1#L163-L166
Trying to reproduce this behaviour with Example project brings unexpected results. The way I had tried:
- Setup database
- Start the example server
- Open http://127.0.0.1:8000 in the Chrome
- Open DevTools with network and console tabs
- Click on
api
WebSocket request and there on Messages tab. Check thatauth/signin
request was successful with the statuslogged
. - Write in console
await api.example.customException();
- The result
{message: "Custom ecxeption", code: 12345}
despite documentation says that unknown error code will generate: "Internal Server Error" with "code":500. - Change error code in the file
application/api/example/customException.js
to404
. Save and check that update has been reloaded by server. - Call again in console
await api.example.customException();
- The result
{message: "Custom ecxeption", code: 404}
instead of automatic replacement of the message with "Not found" as being told at the documentation. - The same behaviour with public endpoint.
What is the desired latest behaviour: that mentioned in documentation OR that actually works in Example?