Skip to content

Commit

Permalink
fix: add customRPC prefix on error in controller
Browse files Browse the repository at this point in the history
  • Loading branch information
oho-mu committed Oct 9, 2024
1 parent d8b9dc6 commit 0ec803b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/background/controller/provider/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,17 @@ class ProviderController extends BaseController {
statsData.signMethod = notificationService.statsData?.signMethod;
}
notificationService.setStatsData(statsData);
throw typeof e === 'object' ? e : new Error(e);
let errMsg = typeof e === 'object' ? e.message : e;
if (RPCService.hasCustomRPC(chain)) {
errMsg = '[From Custom RPC]' + errMsg;
}

throw typeof e === 'object'
? {
...e,
message: errMsg,
}
: new Error(errMsg);
}
};
@Reflect.metadata('SAFE', true)
Expand Down

0 comments on commit 0ec803b

Please sign in to comment.