isApiErrorReasonOf()
function isApiErrorReasonOf<TCode>(code, reason): reason is output<{ CONFLICT: ZodEnum<{ app_user_id_taken: "app_user_id_taken"; checkout_in_progress: "checkout_in_progress"; customer_access_revoked: "customer_access_revoked"; customer_suspended: "customer_suspended"; default_product_grant: "default_product_grant"; default_product_in_use: "default_product_in_use"; grant_already_active: "grant_already_active"; grant_not_cancelable: "grant_not_cancelable"; idempotency_key_reused: "idempotency_key_reused"; source_subscription_ambiguous: "source_subscription_ambiguous" }>; FORBIDDEN: ZodEnum<{ customer_suspended: "customer_suspended"; mode_not_in_scope: "mode_not_in_scope"; permission_missing: "permission_missing"; project_not_in_scope: "project_not_in_scope"; session_required: "session_required"; workspace_access_required: "workspace_access_required" }>; INTERNAL_ERROR: ZodNever; INVALID_REQUEST: ZodEnum<{ invalid_json: "invalid_json"; parameter_invalid: "parameter_invalid"; provider_missing: "provider_missing"; provider_unsupported: "provider_unsupported"; unsupported_endpoint: "unsupported_endpoint" }>; NOT_FOUND: ZodNever; PAYLOAD_TOO_LARGE: ZodNever; PAYMENT_REQUIRED: ZodEnum<{ grant_expired: "grant_expired"; model_not_entitled: "model_not_entitled"; no_active_grant: "no_active_grant" }>; RATE_LIMITED: ZodEnum<{ too_many_concurrent_requests: "too_many_concurrent_requests" }>; SERVICE_UNAVAILABLE: ZodEnum<{ identity_provider_unavailable: "identity_provider_unavailable"; metering_unavailable: "metering_unavailable"; product_not_configured: "product_not_configured"; sign_in_not_configured: "sign_in_not_configured"; stream_authorization_unavailable: "stream_authorization_unavailable" }>; UNAUTHENTICATED: ZodEnum<{ api_key_expired: "api_key_expired"; api_key_invalid: "api_key_invalid"; api_key_revoked: "api_key_revoked"; credentials_malformed: "credentials_malformed"; credentials_missing: "credentials_missing"; customer_access_revoked: "customer_access_revoked"; customer_deleted: "customer_deleted"; identity_provider_unmatched: "identity_provider_unmatched"; identity_subject_deleted: "identity_subject_deleted"; identity_token_expired: "identity_token_expired"; identity_token_invalid: "identity_token_invalid"; session_revoked: "session_revoked"; token_expired: "token_expired"; token_invalid: "token_invalid" }>; USAGE_LIMIT_EXHAUSTED: ZodEnum<{ paid_credits_exhausted: "paid_credits_exhausted"; provider_quota_exhausted: "provider_quota_exhausted"; provider_spend_limit_exhausted: "provider_spend_limit_exhausted"; subscription_quota_exhausted: "subscription_quota_exhausted" }> }[TCode]>;Type Parameters
TCode
TCode extends
| "INVALID_REQUEST"
| "UNAUTHENTICATED"
| "PAYMENT_REQUIRED"
| "FORBIDDEN"
| "NOT_FOUND"
| "CONFLICT"
| "PAYLOAD_TOO_LARGE"
| "RATE_LIMITED"
| "USAGE_LIMIT_EXHAUSTED"
| "SERVICE_UNAVAILABLE"
| "INTERNAL_ERROR"
Parameters
code
TCode
reason
unknown
Last updated on