Skip to content

Commit

Permalink
fix(FetchError): remove extra space if ctx.response.statusText not de…
Browse files Browse the repository at this point in the history
…fined
  • Loading branch information
maximepvrt authored Jan 28, 2025
1 parent 6b617f7 commit f372585
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export function createFetchError<T = any>(
const requestStr = `[${method}] ${JSON.stringify(url)}`;

const statusStr = ctx.response
? `${ctx.response.status} ${ctx.response.statusText}`
: "<no response>";
? `${ctx.response.status}${
ctx.response.statusText ? ` ${ctx.response.statusText}` : ""
}` : "<no response>";

const message = `${requestStr}: ${statusStr}${
errorMessage ? ` ${errorMessage}` : ""
Expand Down

0 comments on commit f372585

Please sign in to comment.