File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -128,14 +128,17 @@ export const toErrorDetail = (
128128 tx : TxMsgValue [ ] ,
129129 error : BroadcastTxError
130130) : string => {
131- const { gasLimit } = tx [ 0 ] . args ;
132- const { code } = error . toProps ( ) ;
133-
134- // TODO: Over time we may expand this to format errors for more result codes
135- switch ( code ) {
136- case ResultCode . TxGasLimit :
137- return `${ error . toString ( ) } Please raise the Gas Amount above the previously provided ${ gasLimit } in the fee options for your transaction.` ;
138- default :
139- return error . toString ( ) ;
131+ try {
132+ const { code } = error . toProps ( ) ;
133+ // TODO: Over time we may expand this to format errors for more result codes
134+ switch ( code ) {
135+ case ResultCode . TxGasLimit :
136+ const { gasLimit } = tx [ 0 ] . args ;
137+ return `${ error . toString ( ) } Please raise the Gas Amount above the previously provided ${ gasLimit } in the fee options for your transaction.` ;
138+ default :
139+ return error . toString ( ) ;
140+ }
141+ } catch ( _e ) {
142+ return `${ error . toString ( ) } ` ;
140143 }
141144} ;
You can’t perform that action at this time.
0 commit comments