@seedcord/errors
v0.8.0
Published
Typed errors with registered codes for seedcord bots
Maintainers
Readme
About
@seedcord/errors holds every error seedcord throws. Each one carries a registered code from SeedcordErrorCode, so a caller can branch on one specific failure.
Framework code never throws a raw Error. A third-party throw may be translated into one of these before you catch it.
Until v1.0.0, minor versions can break.
Installation
Your transport already re-exports this.
pnpm add @seedcord/errorsUsage
isSeedcordError narrows on the class and the code together:
import { isSeedcordError, SeedcordErrorCode } from '@seedcord/errors';
try {
await run();
} catch (error) {
if (isSeedcordError(error, 'SeedcordError', SeedcordErrorCode.CliCancelled)) return;
throw error;
}Called with one argument it narrows to any seedcord error.
