{"version":3,"file":"error.mjs","names":[],"sources":["../src/error.ts"],"sourcesContent":["/**\n * Common shape of error bodies returned by the Storyblok Management API.\n *\n * Most error responses include an `error` field with a human-readable message.\n */\nexport interface ApiErrorBody {\n  error?: string;\n  message?: string;\n  [key: string]: unknown;\n}\n\n/**\n * Structured HTTP error thrown by the Management API client when `throwOnError: true`.\n */\nexport class ClientError extends Error {\n  readonly response: { status: number; statusText: string; data: ApiErrorBody | undefined };\n\n  constructor(message: string, options: { status: number; statusText: string; data: unknown }) {\n    super(message);\n    this.name = \"ClientError\";\n    this.response = {\n      status: options.status,\n      statusText: options.statusText,\n      data: options.data as ApiErrorBody | undefined,\n    };\n  }\n}\n"],"mappings":";;;;AAcA,IAAa,cAAb,cAAiC,MAAM;CACrC;CAEA,YAAY,SAAiB,SAAgE;EAC3F,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,WAAW;GACd,QAAQ,QAAQ;GAChB,YAAY,QAAQ;GACpB,MAAM,QAAQ;EAChB;CACF;AACF"}