Skip to main content

Error Types

Reference for ConvexCallError, normalization, and serialized errors.

ts
import {
  ConvexCallError,
  isSerializedConvexCallError,
  normalizeConvexError,
  type ConvexCallErrorKind,
  type SerializedConvexCallError,
} from '@lupinum/better-convex-nuxt/errors'

ConvexCallErrorKind

ts
type ConvexCallErrorKind = 'authentication' | 'transport' | 'server' | 'unknown'

ConvexCallError

FieldType
name'ConvexCallError'
kindConvexCallErrorKind
messagestring
codestring | undefined
statusnumber | undefined
dataunknown

ConvexCallError deliberately has no cause; raw upstream values cannot be recovered from direct access, inspection, cloning, JSON, or SSR serialization.

normalizeConvexError

ts
normalizeConvexError(error: unknown): ConvexCallError

It passes an existing ConvexCallError through, recognizes structured Convex application errors as server, and returns unknown when no stable classification exists. It does not classify from message substrings.

Serialized guard

ts
isSerializedConvexCallError(value): value is SerializedConvexCallError

Use the guard at custom serialization boundaries. Nuxt payload revival is installed by the module automatically.