Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed Nov 5, 2023
1 parent d11c8f7 commit 54bce0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions shadow.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,17 @@ export class Shadow extends HTMLElement {
} else {
throw new Error("The rpc result is not an object.");
}
} catch (rpcError) {
} catch (error) {
this.dispatchEvent(
new CustomEvent("rpcError", {
new CustomEvent("error", {
bubbles: true,
composed: true,
detail: { rpcError },
detail: { error },
}),
);
const errorMessage =
`Received rpc error code ${rpcError?.code} with the message: "${rpcError?.message}"${
rpcError?.data ? ":\n" + rpcError.data : "."
`Received rpc error code ${error?.code} with the message: "${error?.message}"${
error?.data ? ":\n" + error.data : "."
}`;
throw new ShadowError(errorMessage);
}
Expand Down

0 comments on commit 54bce0b

Please sign in to comment.