## TL;DR

Every failed call rejects with a UnitError carrying the HTTP status, Unit's request ID, the JSON:API error objects, and a retryable flag; log error.requestId with your support tickets. The client auto-retries 429 and 5xx with exponential backoff and jitter honoring Retry-After, configurable via retryPolicy.

## The error

```text
error handling - UnitError fields and retry policy
```

## Fix

1. Every failed call rejects with a UnitError carrying the HTTP status, Unit's request ID, the JSON:API error objects, and a retryable flag; log error.requestId with your support tickets.
   Expected: You get the expected result; the problem is gone.
2. Re-run the original operation and confirm the error is gone.
   Expected: no error, normal output.

## When to use

- You hit this exact error with Unit.co.
- The symptom matches: error handling - UnitError fields and retry policy.

## When NOT to use

- A different error message from Unit.co; the cause here is specific to this error.
- Unrelated Unit.co issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported against Unit.co. Source: https://github.com/fintech-sdk/unit-sdk.

## Variant phrasings

### error handling - UnitError fields and retry policy

## Why it happens

Calls to the Unit API fail and you need the right fields for logging and retry decisions.

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.

## Source

https://github.com/fintech-sdk/unit-sdk