Base error class for all LedeWire SDK errors. All errors thrown by the SDK are instances of this class, making it safe to use err instanceof LedewireError as a type guard.
err instanceof LedewireError
try { await client.purchases.create({ contentId: '...' })} catch (err) { if (err instanceof LedewireError) { console.error(err.statusCode, err.message) }} Copy
try { await client.purchases.create({ contentId: '...' })} catch (err) { if (err instanceof LedewireError) { console.error(err.statusCode, err.message) }}
Optional
Readonly
Machine-readable error code from the API error body, if present.
HTTP status code returned by the API (e.g. 400, 401, 404, 422).
Base error class for all LedeWire SDK errors. All errors thrown by the SDK are instances of this class, making it safe to use
err instanceof LedewireErroras a type guard.Example