Error Handling
onError
Section titled “onError”| Type | (error: UpdogError) => void |
Called when the SDK catches an internal error. The SDK recovers gracefully where possible — onError is for your logging and monitoring (Sentry, Datadog, etc.).
Error Shape
Section titled “Error Shape”type UpdogError = { code: UpdogErrorCode; message: string; source: string; originalError?: unknown;};Error Codes
Section titled “Error Codes”| Code | When |
|---|---|
PARSE_ERROR | File parsing failed (corrupt CSV, invalid XLSX, etc.) |
RENDER_ERROR | Component render failed (caught by error boundary) |
TRANSFORM_ERROR | Data transformation failed (column transform, value mapping) |
VALIDATION_ERROR | Validation execution failed (validator threw instead of returning) |
WORKER_ERROR | Web Worker failed (filter worker, chat transform worker) |
COMMAND_ERROR | Undo/redo command failed |
OPERATION_ERROR | General operation failed (bulk mutations, imports) |
Example
Section titled “Example”onError={(error) => { Sentry.captureException(error.originalError ?? error, { tags: { code: error.code, source: error.source }, });}}CSV parse warnings
Section titled “CSV parse warnings”Malformed rows in a CSV (for example, an unclosed quote) don’t fail the import. The file still parses and the rows enter the grid; the user sees a toast reporting how many rows had formatting issues and the first few affected row numbers. These warnings are informational and are not reported through onError. A hard parse failure still raises a PARSE_ERROR.