Skip to content

Commit

Permalink
Improve error messaging on http errors
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Sep 22, 2023
1 parent da751c0 commit b16fc0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/trpc/trpc.serverutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ function createFetcherFromTRPC<TPostBody, TOut>(parser: (response: Response) =>
code: 'BAD_REQUEST',
message: error
? `[${moduleName} Issue] ${error?.error?.message || error?.error || error?.toString() || 'Unknown http error'}`
: `[Issue] ${response.statusText} (${response.status})` + (response.status === 403 ? ` - is ${url} accessible by the server?` : ''),
: `[Issue] ${moduleName} ${response.statusText} (${response.status})`
+ (response.status === 403 ? ` - is ${url} accessible by the server?` : '')
+ (response.status === 502 ? ` - is ${url} down?` : ''),
});
}
try {
Expand Down

1 comment on commit b16fc0b

@vercel
Copy link

@vercel vercel bot commented on b16fc0b Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

big-agi – ./

big-agi-git-main-enricoros.vercel.app
big-agi-enricoros.vercel.app
get.big-agi.com

Please sign in to comment.