@arizeai/phoenix-client
Version:
A client for the Phoenix API
22 lines • 818 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpError = void 0;
/**
* Thrown when Phoenix answers a request with a non-2xx status.
*
* `status` is on the error so callers can branch on it: a status is frequently
* a legitimate answer rather than a bug — a 401 from an unauthenticated probe,
* for instance, is how a caller learns that auth is enabled on the deployment.
*/
class HttpError extends Error {
constructor(response) {
super(`${response.url}: ${response.status} ${response.statusText}`);
this.name = "HttpError";
this.response = response;
this.status = response.status;
this.statusText = response.statusText;
this.url = response.url;
}
}
exports.HttpError = HttpError;
//# sourceMappingURL=errors.js.map