Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export type SnapExecutionData = {
export type SnapErrorJson = {
message: string;
code: number;
data?: Json;
data?: Record<string, Json>;
};

export type ExecutionServiceUnhandledErrorEvent = {
Expand Down
5 changes: 4 additions & 1 deletion packages/snaps-controllers/src/snaps/SnapController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,10 @@ export class SnapController extends BaseController<
_onUnhandledSnapError(snapId: string, error: SnapErrorJson) {
// Log the error that caused the crash
// so it gets raised to the developer for debugging purposes.
logError(`Unhandled error from "${snapId}":`, error);
logError(
`Unhandled error from "${snapId}":`,
getErrorMessage(error.data?.cause ?? error),
);
this.stopSnap(snapId as SnapId, SnapStatusEvents.Crash).catch(
(stopSnapError) => {
// TODO: Decide how to handle errors.
Expand Down
Loading