-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
When intercepting an error in a try...catch block, the error should never be lost. I'm currently trying to debug an issue with DefaultDIDAdapter from another project, but the only error I get doesn't have any source, or "caused by".
Here's the actual code from DefaultDIDAdapter:
try {
return await this.performRequest(this.rpcEndpoint, request);
} catch (e) {
throw new NetworkException("Network error.");
}
The catch block only forwards the error, but it should instead wrap it like this:
throw new NetworkException("Network error.", e);
This way, the source isn't lost.
This is only an example, but there are many other missing errors.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels