Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Defines and checks native error classes in each package's src/errors.ts, using stable name fields for Ledger Live.
36% 91%+55 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 8 of 22 without it.
This test ran on v2. v4 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
30 agent runs
1 forkA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
Each package owns its errors in its own src/errors.ts, as plain native classes.
There is no shared errors lib: the former @ledgerhq/errors package has been removed.
A package groups its errors in src/errors.ts. Extend Error directly and set a
stable name. The name string is the contract — keep it stable, it is what
survives across process/serialization boundaries.
// message-only
export class FooNotFound extends Error {
override name = "FooNotFound";
}
// with a default message
export class InvalidChallenge extends Error {
override name = "InvalidChallenge";
constructor() {
super("backend returned an invalid challenge");
}
}
// with extra fields
export class HttpError extends Error {
override name = "HttpError";
readonly status: number | undefined;
constructor(message: string, status?: number) {
super(message);
this.status = status;
}
}
Group a family under a per-package base class so callers can catch the whole set. An excerpt of
domain/entity/contact/src/errors.ts, which holds
the full family:
Next to this one in the catalogue, plus more from the same author.