Skip to content

Commit

Permalink
chore: update error message
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-phan committed Jul 25, 2024
1 parent 101d592 commit 0d1b542
Show file tree
Hide file tree
Showing 4 changed files with 10,177 additions and 1,516 deletions.
2 changes: 1 addition & 1 deletion packages/biome/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"a11y": {
"noSvgWithoutTitle": "warn",
"useMediaCaption": "warn",
"useKeyWithClickEvents": "warn"
"useKeyWithClickEvents": "off"
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions packages/hydrogen/src/weaverse-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class WeaverseClient {
const res = await fetch(url, reqInit)
return await res.json<T>()
} catch (err) {
throw new Error(err)
throw new Error(`Failed to fetch data from ${url}`, { cause: err })
}
}
let res = this.withCache(cacheKey, strategy, async () => {
Expand All @@ -102,7 +102,7 @@ export class WeaverseClient {
if (!response.ok) {
let error = await response.text()
let { status, statusText } = response
throw new Error(`${status} ${statusText} ${error}`)
throw new Error(`${status} ${statusText} ${error}`, { cause: error })
}
return await response.json<T>()
})
Expand All @@ -117,6 +117,7 @@ export class WeaverseClient {
throw new Error('Missing Weaverse projectId!')
}
let url = `${weaverseHost}/${API}/project_configs`
// biome-ignore lint/suspicious/noImplicitAnyLet: <explanation>
let res
let body = JSON.stringify({ isDesignMode, projectId })
if (isDesignMode) {
Expand Down
Loading

0 comments on commit 0d1b542

Please sign in to comment.