> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # TokenRefreshError > Thrown when an access-token refresh fails. Raised when the SDK attempts to refresh an expiring access token (SAT) and the refresh endpoint returns an error or unparsable response. After this fires, the session continues using the current token until expiry; once that lapses the connection will be torn down. Catching this is your cue to obtain a fresh token out-of-band. ## **Extends** * `Error` ## **Constructors** ### Constructor ```ts new TokenRefreshError(message, originalError?): TokenRefreshError ``` #### Parameters **`message`** `string` — required Human-readable error message. --- **`originalError`** `unknown` Underlying error returned by the token-refresh endpoint. --- #### Returns `TokenRefreshError` ## **Properties** **`originalError`** `unknown` Underlying error returned by the token-refresh endpoint. --- ## **Examples** ```ts import { TokenRefreshError } from '@signalwire/js'; client.errors$.subscribe((err) => { if (err instanceof TokenRefreshError) { console.warn('token refresh failed:', err.message, err.originalError); void rotateCredentialProvider(); } }); ``` > Thrown when an access-token refresh fails.