Skip to main content

isBad

Checks if an interaction has a failed status.

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.isBad(ix)

Or import directly the specific function:


_10
import { isBad } from "@onflow/sdk"
_10
_10
isBad(ix)

Usage


_10
import * as fcl from "@onflow/fcl";
_10
import { isBad, why } from "@onflow/sdk"
_10
_10
const response = await fcl.send([
_10
fcl.transaction`transaction { prepare(account: AuthAccount) {} }`
_10
]);
_10
_10
if (isBad(response)) {
_10
console.log("Transaction failed:", why(response));
_10
}

Parameters

ix

  • Type: Interaction
  • Description: The interaction to check

Returns

boolean


Rate this page