# Errors

Error codes and structured error details.

[Read the errors and receipts guide](/docs/errors/). Signatures below come from the published SDK declarations. Access SDK services through `db`; use their constructors only when integrating at a lower level.

## ErrorCode


```ts
type ErrorCode =
  | "INVALID_CONFIG"
  | "INVALID_RECORD"
  | "INVALID_QUERY"
  | "AUTH_REQUIRED"
  | "AUTH_FAILED"
  | "PERMISSION_DENIED"
  | "CONFLICT"
  | "RELAY_ERROR"
  | "PUBLISH_FAILED"
  | "NOT_FOUND"
  | "MULTIPLE_ROWS"
  | "ABORTED"
  | "CLIENT_CLOSED";
```

## NostrbaseError


```ts
declare class NostrbaseError extends Error {}
```

### Properties


```ts
readonly code: ErrorCode;
readonly details?: unknown | undefined;
readonly name = "NostrbaseError";
```

### constructor


```ts
constructor(code: ErrorCode, message: string, details?: unknown | undefined);
```
