Skip to content

PostcodeException

Gatepost\Postcode\Client\PostcodeException

The error of a client call: bad input, a refusal or failure of the gateway, or no response. errorCode() gives the reason as a stable code. No message holds the API key.

public function errorCode(): Client\ErrorCode

The reason for the failure, as a stable code.

public function status(): ?int

The HTTP status of the response, or null when no response arrived.

public function apiCode(): ?string

The error.code of the response body, such as level_not_granted, or null.

public function retryAfterMs(): ?int

The wait in milliseconds that a valid Retry-After header of a 429, 502, 503 or 504 asked for, or null. Tell the user when to try again.

Unofficial. Not made or endorsed by NIPOST.