SDK Errors
VibeLands uses stable, JSON-safe SDK error codes. Code compares against code, not human-readable message; messages may become clearer without changing the contract. The canonical registry is @vibelands/mod-sdk/shared:
ts
import {
ModSdkError,
MOD_SDK_ERRORS,
isModSdkErrorShape,
} from '@vibelands/mod-sdk/shared';Every wire-safe envelope has code, message, and the registry-defined retryable flag. It may also carry operationId and non-sensitive JSON details. Stack traces, database errors, secrets, and private host internals are never part of the public envelope.
| Code | Meaning | Retryable |
|---|---|---|
VB_SDK_PERMISSION_DENIED | Required capability was not granted | no |
VB_SDK_VALIDATION_FAILED | Input, schema, payload, or identifier is invalid | no |
VB_SDK_QUOTA_EXCEEDED | Resource or byte quota is exhausted | no |
VB_SDK_RATE_LIMITED | Current rate budget was exceeded | yes |
VB_SDK_NOT_FOUND | Scoped resource is absent or not visible | no |
VB_SDK_NOT_OWNED | Resource is outside the mod's ownership scope | no |
VB_SDK_CONFLICT | State, revision, or lease conflicts | yes |
VB_SDK_UNAVAILABLE | Capability/backing service is temporarily unavailable | yes |
VB_SDK_PROTOCOL_MISMATCH | Caller and host contracts are incompatible | no |
VB_SDK_INTERNAL | Sanitized unexpected host failure | yes |
Existing API v2 boolean/null methods retain their compatibility behavior. New command/query surfaces return or throw these structured errors; Creator includes the exact installed registry in both JSON and agent Markdown context.