Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document errors usage #25

Open
mutantcornholio opened this issue Sep 3, 2024 · 0 comments
Open

Document errors usage #25

mutantcornholio opened this issue Sep 3, 2024 · 0 comments

Comments

@mutantcornholio
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant