Skip to content

Error Codes Reference

VibeDepot uses a structured error system called DxError. Every error thrown by the Bridge API includes a machine-readable code, a human-readable message, and a developer-friendly suggestion.

{
code: DxErrorCode; // Machine-readable error type
message: string; // What went wrong
suggestion: string; // How to fix it
}

The app attempted to use a Bridge API method without the required permission.

PropertyValue
WhenAny Bridge call where the app lacks the required permission
MessageApp "{appId}" does not have "{permission}" permission
SuggestionAdd "{permission}" to the permissions array in your manifest.json

Resolution: Add the missing permission to your manifest.json permissions array.

// Example: App calls AI without "ai" permission
try {
await window.vibeDepot.ai.callAI({ messages: [...] });
} catch (err) {
// err.code === 'PERMISSION_DENIED'
}

No API key is configured for any provider the app supports.

PropertyValue
WhenAI call when no supported provider has a key configured
MessageNo API key available. Tried providers: {providers}
SuggestionOpen Settings and add an API key for one of your app's supported providers

Resolution: The user needs to add an API key in VibeDepot Settings for at least one of the providers listed in the app’s models.providers.


The parameters passed to a Bridge API method failed Zod validation.

PropertyValue
WhenAny Bridge call with malformed parameters
MessageInvalid parameters: {field}: {issue}; ...
SuggestionCheck the Bridge API documentation for the correct parameter format

Resolution: Check the parameter format against the Bridge API Reference. Common issues:

  • Missing required messages array in AI calls
  • Invalid role value (must be 'user', 'assistant', or 'system')
  • temperature outside 0–2 range
  • Storage key exceeding 256 characters

The AI provider’s API returned an error.

PropertyValue
WhenThe AI SDK call fails (rate limit, invalid key, insufficient credits, etc.)
Message{provider} API error: {originalMessage}
SuggestionCheck that your API key is valid and you have sufficient credits

Resolution: Common causes:

  • Invalid or expired API key
  • Insufficient account credits
  • Rate limit exceeded
  • Model not available for the account
  • Network connectivity issues

A KV storage operation failed.

PropertyValue
WhenKV storage read/write fails (disk error, corruption, etc.)
MessageStorage {operation} failed: {originalMessage}
SuggestionEnsure your app has the correct storage permissions in manifest.json

Resolution: Usually indicates a disk issue or corrupted store.json. The user can clear the app’s data from the Library.


A SQLite database operation failed.

PropertyValue
WhenSQL execution fails (syntax error, blocked statement, constraint violation, etc.)
MessageDatabase {operation} failed: {originalMessage}
SuggestionCheck your SQL syntax and ensure your app has "storage.db" permission in manifest.json

Resolution: Common causes:

  • SQL syntax error
  • Using a blocked SQL statement (see SQL Allowlist)
  • Constraint violation (unique, not null, foreign key)
  • Missing storage.db permission

An unexpected error occurred.

PropertyValue
WhenAny unhandled exception in the main process
MessageVaries
SuggestionVaries

Resolution: Check the error message for details. If the issue persists, report it.

The codebase provides factory functions for creating errors consistently (defined in packages/shared/src/dx-errors.ts):

FunctionCreates
permissionDenied(appId, permission)PERMISSION_DENIED
missingApiKey(triedProviders)MISSING_API_KEY
invalidParams(zodError)INVALID_PARAMS
aiProviderError(provider, originalMessage)AI_PROVIDER_ERROR
storageError(operation, originalMessage)STORAGE_ERROR
dbError(operation, originalMessage)DB_ERROR
try {
const response = await window.vibeDepot.ai.callAI({
messages: [{ role: 'user', content: 'Hello' }]
});
} catch (err) {
switch (err.code) {
case 'PERMISSION_DENIED':
case 'MISSING_API_KEY':
case 'INVALID_PARAMS':
case 'AI_PROVIDER_ERROR':
case 'STORAGE_ERROR':
case 'DB_ERROR':
console.error(`[${err.code}] ${err.message}`);
console.info('Fix:', err.suggestion);
break;
default:
console.error('Unexpected error:', err);
}
}