metarhia / Docs

Metarhia docs and F.A.Q. 📒
https://metarhia.com
MIT License
83 stars 8 forks source link

Last thesis in error-handling guidelines isn't reproducible #21

Open KLarpen opened 11 months ago

KLarpen commented 11 months ago

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 commented 11 months ago

Please review @tshemsedinov . The PR proposal may be created only based on an answer to the last question.

KLarpen commented 10 months ago

The question was reviewed at the community call 133 14.12.2023. Decision: the right behavior in the documentation, so it must be reported as issue into code repository impress or metacom.