API Error thrown when European Parliament API requests fail.
When thrown from BaseEPClient's HTTP layer, the message always
includes the numeric HTTP status code and, when present, the HTTP reason
phrase (statusText). Some HTTP/2 responses omit statusText, in which
case the message contains only the status code — the status code is
therefore always surfaced in the message, never empty.
Message format: EP API request failed: <status>[ <statusText>]
Example
// HTTP/1.1 with a reason phrase thrownewAPIError('EP API request failed: 404 Not Found', 404, { endpoint:'/meps/999999' });
// HTTP/2 where statusText is empty thrownewAPIError('EP API request failed: 404', 404, { endpoint:'/meps/999999' });
API Error thrown when European Parliament API requests fail.
When thrown from BaseEPClient's HTTP layer, the message always includes the numeric HTTP status code and, when present, the HTTP reason phrase (
statusText). Some HTTP/2 responses omitstatusText, in which case the message contains only the status code — the status code is therefore always surfaced in the message, never empty.Message format:
EP API request failed: <status>[ <statusText>]Example