Cluebase Docs

Custom Errors

While Cluebase automatically catches crashes, you can also enrich your error reporting by throwing or reporting custom error objects with additional context.

Enriching Errors

When throwing errors that you expect Cluebase to catch, you can attach additional metadata if you are using custom error classes.

typescript
class PaymentError extends Error {
  constructor(message: string, public transactionId: string) {
    super(message);
    this.name = 'PaymentError';
  }
}

// In your code
throw new PaymentError('Transaction failed', 'tx_123');

Filtering Sensitive Data

Cluebase automatically attempts to scrub sensitive data, but you can configure custom sanitization rules in the provider.

Privacy First
Never include PII (Personally Identifiable Information) like credit card numbers or passwords directly in error messages.