Class

UnsupportedError

UnsupportedError(msg)

Constructor

# new UnsupportedError(msg)

This error is thrown when an operation is requested that is not supported by the current persistence adapter or configuration. It extends the BaseError class and sets a 500 status code.

Error thrown when an unsupported operation is attempted

Parameters:
Name Type Description
msg string | Error

The error message or an Error object to wrap

View Source persistence/errors.ts, line 3

Example
```typescript
// Throwing an UnsupportedError
if (!adapter.supportsTransactions()) {
  throw new UnsupportedError('Transactions are not supported by this adapter');
}

// Catching an UnsupportedError
try {
  await adapter.beginTransaction();
} catch (error) {
  if (error instanceof UnsupportedError) {
    console.error('Operation not supported:', error.message);
  }
}
```