es/ae/contract.js
async function handleCallError (result) {
  const error = Buffer.from(result.returnValue).toString()
  if (isBase64(error.slice(3))) {
    const decodedError = Buffer.from(error.slice(3), 'base64').toString()
    throw Object.assign(Error(`Invocation failed: ${error}. Decoded: ${decodedError}`), R.merge(result, { error, decodedError }))
  }

  const decodedError = await this.contractDecodeData('string', error)
  throw Object.assign(Error(`Invocation failed: ${error}. Decoded: ${decodedError}`), R.merge(result, { error, decodedError }))
}
async function handleCallError (result) {
  const error = Buffer.from(result.returnValue).toString()
  if (isBase64(error.slice(3))) {
    const decodedError = Buffer.from(error.slice(3), 'base64').toString()
    throw Object.assign(Error(`Invocation failed: ${error}. Decoded: ${decodedError}`), R.merge(result, { error, decodedError }))
  }

  const decodedError = await this.contractDecodeData('string', error)
  throw Object.assign(Error(`Invocation failed: ${error}. Decoded: ${decodedError}`), R.merge(result, { error, decodedError }))
}
async function handleCallError ( result ) { const error = Buffer . from ( result . returnValue ) . toString ( ) if ( isBase64 ( error . slice ( 3 ) ) ) { const decodedError = Buffer . from ( error . slice ( 3 ) , 'base64' ) . toString ( ) throw Object . assign ( Error ( ` ${ error } ${ decodedError } ` ) , R . merge ( result , { error , decodedError } ) ) } const decodedError = await this . contractDecodeData ( 'string' , error ) throw Object . assign ( Error ( ` ${ error } ${ decodedError } ` ) , R . merge ( result , { error , decodedError } ) ) }
Handle contract call error
@function
@alias module:@aeternity/aepp-sdk/es/ae/contract
@category async
@param {Object} result call result object
@throws Error Decoded error
@return {Promise<void>}
Handle contract call error