Skip to main content

ExecutionError

Thrown when the Droid CLI process exits with an error.

Import

import { ExecutionError } from '@activade/droid-sdk';

Properties

exitCode

readonly exitCode: number | null

The CLI process exit code, or null if unavailable.

stderr

readonly stderr: string

Standard error output from the CLI.

stdout

readonly stdout: string

Standard output from the CLI (may contain partial results).

Usage

try {
await droid.exec('Risky operation');
} catch (error) {
if (error instanceof ExecutionError) {
console.error('Execution failed:');
console.error('Exit code:', error.exitCode);
console.error('Error output:', error.stderr);
console.error('Standard output:', error.stdout);
}
}

Common Causes

  1. Invalid prompt - Malformed or empty prompt
  2. Permission denied - Insufficient permissions for file operations
  3. Tool failure - A tool returned an error
  4. API error - Backend API returned an error

Debugging

try {
await droid.exec(prompt);
} catch (error) {
if (error instanceof ExecutionError) {
// Log full error details
console.error({
message: error.message,
exitCode: error.exitCode,
stderr: error.stderr,
stdout: error.stdout
});

// Check for specific error patterns
if (error.stderr.includes('permission denied')) {
console.log('Try running with higher autonomy level');
}
}
}