move errorParsing.ts to core (#6159)

This commit is contained in:
Adam Weidman
2025-08-13 17:57:11 +00:00
committed by GitHub
parent 9c7fb870c1
commit b61a63aef4
7 changed files with 19 additions and 23 deletions
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { StructuredError } from '../core/turn.js';
export interface ApiError {
error: {
code: number;
@@ -13,11 +15,6 @@ export interface ApiError {
};
}
interface StructuredError {
message: string;
status?: number;
}
export function isApiError(error: unknown): error is ApiError {
return (
typeof error === 'object' &&