@civitai/client 0.2.0-beta.2 → 0.2.0-beta.21

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.
@@ -13,7 +13,9 @@ export function createCivitaiClient(config) {
13
13
  client.interceptors.response.use(async (response) => {
14
14
  if (!response.ok) {
15
15
  const error = (response.status === 400
16
- ? await response.json()
16
+ ? await response
17
+ .json()
18
+ .catch(() => ({ status: response.status, detail: response.statusText }))
17
19
  : { status: response.status, detail: response.statusText });
18
20
  const newResponse = new Response(JSON.stringify(error), {
19
21
  status: response.status,