This repository was archived by the owner on Jun 6, 2025. It is now read-only.
This repository was archived by the owner on Jun 6, 2025. It is now read-only.
Errors vs failures and logging #244
Open
Description
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.