Docs icon indicating copy to clipboard operation
Docs copied to clipboard

Last thesis in error-handling guidelines isn't reproducible

Open KLarpen opened this issue 6 months ago • 2 comments

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:

  1. Setup database
  2. Start the example server
  3. Open http://127.0.0.1:8000 in the Chrome
  4. Open DevTools with network and console tabs
  5. Click on api WebSocket request and there on Messages tab. Check that auth/signin request was successful with the status logged.
  6. Write in console await api.example.customException();
  7. The result {message: "Custom ecxeption", code: 12345} despite documentation says that unknown error code will generate: "Internal Server Error" with "code":500.
  8. Change error code in the file application/api/example/customException.js to 404. Save and check that update has been reloaded by server.
  9. Call again in console await api.example.customException();
  10. The result {message: "Custom ecxeption", code: 404} instead of automatic replacement of the message with "Not found" as being told at the documentation.
  11. The same behaviour with public endpoint.

What is the desired latest behaviour: that mentioned in documentation OR that actually works in Example?

KLarpen avatar Dec 09 '23 17:12 KLarpen