@arizeai/phoenix-client
Version:
A client for the Phoenix API
19 lines • 502 B
JavaScript
export function formatApiError(error) {
if (typeof error === "string") {
return error;
}
if (error && typeof error === "object") {
const errorWithDetail = error;
if (typeof errorWithDetail.detail === "string") {
return errorWithDetail.detail;
}
try {
return JSON.stringify(error);
}
catch {
return String(error);
}
}
return String(error);
}
//# sourceMappingURL=apiErrorUtils.js.map