Skip to main content

ChurnKitError

All SDK methods throw ChurnKitError on failure. It extends Error and adds status (HTTP status code) and code (typed error constant).

Error codes

Handling patterns

Ignore cancellations

Exhaustive switch with type narrowing

Non-blocking with error logging

isKnownErrorCode()

Type guard that narrows err.code to a well-known ErrorCode constant — useful for exhaustive switch statements.