You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to override error codes: `throw new Error('Method is not implemented', 404);`
This will take error message from code: `{"callback":1,"error":{"message":"Not found","code":404}}`
If you specify unknown code like this: `throw new Error('Method is not implemented', 12345);` this will generate: `"Internal Server Error"` with `"code":500`.
Trying to reproduce this behaviour with Example project brings unexpected results. The way I had tried:
Click on api WebSocket request and there on Messages tab. Check that auth/signin request was successful with the status logged.
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.
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?
The text was updated successfully, but these errors were encountered:
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.
The documentation section Error-handling guidelines contains the sentences
Docs/content/en/LAYERS.md
Lines 163 to 166 in 3f3b82e
Trying to reproduce this behaviour with Example project brings unexpected results. The way I had tried:
api
WebSocket request and there on Messages tab. Check thatauth/signin
request was successful with the statuslogged
.await api.example.customException();
{message: "Custom ecxeption", code: 12345}
despite documentation says that unknown error code will generate: "Internal Server Error" with "code":500.application/api/example/customException.js
to404
. Save and check that update has been reloaded by server.await api.example.customException();
{message: "Custom ecxeption", code: 404}
instead of automatic replacement of the message with "Not found" as being told at the documentation.What is the desired latest behaviour: that mentioned in documentation OR that actually works in Example?
The text was updated successfully, but these errors were encountered: