File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -277,8 +277,10 @@ export class Provider implements IProvider {
277277 this
278278 )
279279 } catch ( e ) {
280- console . error ( '[AnyWeb] Error to sendTransaction' , e )
281- return e
280+ throw new ProviderRpcError (
281+ ProviderErrorCode . SendTransactionError ,
282+ 'Error to sendTransaction: ' + e
283+ )
282284 }
283285 case 'anyweb_importAccount' :
284286 try {
@@ -293,8 +295,10 @@ export class Provider implements IProvider {
293295 this
294296 )
295297 } catch ( e ) {
296- console . error ( '[AnyWeb] Error to import Address' , e )
297- return e
298+ throw new ProviderRpcError (
299+ ProviderErrorCode . ImportAddressError ,
300+ 'Error to import Address: ' + e
301+ )
298302 }
299303 case 'anyweb_version' :
300304 return config . version
Original file line number Diff line number Diff line change @@ -367,6 +367,9 @@ export enum ProviderErrorCode {
367367 ChainDisconnected = 4901 ,
368368 SDKNotReady = 5000 ,
369369 ParamsError = 6000 ,
370+ RequestError = 7000 ,
371+ SendTransactionError = 7001 ,
372+ ImportAddressError = 7002 ,
370373}
371374
372375export class ProviderRpcError extends Error implements IProviderRpcError {
You can’t perform that action at this time.
0 commit comments