Skip to main content
@rubric-app/core ships a small hierarchy of typed error classes. All inherit from GovernanceError, which inherits from the standard Error.

GovernanceError

Base class for every Rubric-thrown error. Catch this to handle any SDK failure generically:

GovernanceProblemError

Thrown when Rubric returns an RFC 9457 problem-details response. Carries the parsed body so you can branch on problem.type instead of parsing error strings.

IdentityRevokedError

Thrown when the server says the agent’s identity is no longer valid. After this throws, the TokenStore enters a terminal dead state — subsequent calls to tokenStore.token() will also throw. Recovery: re-enroll the agent (mint a fresh enrollment token, restart the process). The agentName is idempotent, so you’ll get the same agent id back.

IdentityNotInitializedError

Thrown when something tries to use a TokenStore that hasn’t been bootstrapped yet. You shouldn’t see this in normal use — bootstrapTokenStore does the initial enrollment for you.

Helpers

@rubric-app/core also exports two utilities for working with unknown thrown values without unsafe casts:
These are exposed under the _internal.ts umbrella — stable in practice but not covered by the public semver contract.