@eyepop.ai/eyepop 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -622,6 +622,7 @@ interface ModelExport {
622
622
  exported_by: ExportedBy;
623
623
  export_params?: QcAiHubExportParams;
624
624
  status: ModelExportStatus;
625
+ status_message?: string;
625
626
  }
626
627
  interface Model {
627
628
  uuid: string;
@@ -622,6 +622,7 @@ interface ModelExport {
622
622
  exported_by: ExportedBy;
623
623
  export_params?: QcAiHubExportParams;
624
624
  status: ModelExportStatus;
625
+ status_message?: string;
625
626
  }
626
627
  interface Model {
627
628
  uuid: string;
@@ -11218,17 +11218,19 @@ var DataEndpoint = class extends Endpoint {
11218
11218
  if (response.status === 204) {
11219
11219
  return null;
11220
11220
  }
11221
+ const contentType = response.headers.get("Content-Type");
11222
+ this._requestLogger.debug("Response - " + response.status + " " + response.statusText);
11221
11223
  if (!response.ok) {
11222
- const errorData = await response.json();
11223
- throw new Error(errorData.detail || "Request failed");
11224
+ if (contentType && (contentType.toLowerCase().startsWith("application/json") || contentType.toLowerCase().startsWith("text/"))) {
11225
+ throw new Error(`Request failed with ${response.status} ${response.statusText}: ${await response.text()}`);
11226
+ } else {
11227
+ throw new Error(`Request failed with ${response.status} ${response.statusText}`);
11228
+ }
11224
11229
  }
11225
- const contentType = response.headers.get("Content-Type");
11226
- if (contentType && contentType.startsWith("image/")) {
11227
- const blob = await response.blob();
11228
- return blob;
11230
+ if (contentType && contentType.toLowerCase().startsWith("application/json")) {
11231
+ return await response.json();
11229
11232
  }
11230
- this._requestLogger.debug("Response - " + response.status + " " + response.statusText);
11231
- return response.json();
11233
+ return await response.blob();
11232
11234
  }
11233
11235
  async listDatasets(include_stats = true, modifiable_version_only) {
11234
11236
  const modifiableVersionQuery = typeof modifiable_version_only !== "undefined" ? `&modifiable_version_only=${modifiable_version_only}` : "";