Skip to content

Document errors usage #25

Open
Open
@mutantcornholio

Description

@mutantcornholio

I have no idea now to use errors that papi generates...

It's mentioned in codegen part
but not alongside other generated APIs, like constants

I see you can import the type, like this:

import { WestendErrors } from "@polkadot-api/descriptors";
// and probably do something like 
const error: WestendErrors["Preimage"]["NotNoted"] = undefined;

But how do you actually get instances of these errors and match them in runtime?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions