Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors vs failures and logging #244

Open
johanandren opened this issue Feb 22, 2022 · 0 comments
Open

Errors vs failures and logging #244

johanandren opened this issue Feb 22, 2022 · 0 comments
Labels
javascript-sdk kalix-runtime Runtime and SDKs sub-team

Comments

@johanandren
Copy link
Contributor

Not sure what is the expected behavior in general by JS/TS devs but in the Java SDK we treat a .failure(...) response as a validation error or expected failure that you only want returned to the user, while an thrown exception/error is something unexpected that we log as an error and return something like an "Internal Server Error" response to the user (not leaking service internal details).

The JS SDK currently handles both these cases the same, logging at debug and returning a failure response of the error turned into string: https://github.com/lightbend/akkaserverless-javascript-sdk/blob/main/sdk/src/action-support.js#L369

We should probably revisit this. And also align the error handling of the different components.

@johanandren johanandren added the kalix-runtime Runtime and SDKs sub-team label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript-sdk kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

No branches or pull requests

2 participants