Skip to content

Commit

Permalink
improve error message for failed images
Browse files Browse the repository at this point in the history
  • Loading branch information
cws committed Jan 7, 2021
1 parent cf805ea commit c8fc100
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const imageDimensions = async (url: string | undefined | null, noCache?:

}
} while (hasError && retry < maxRetries)
if (hasError) throw new Error(`images.ts: Bad network connection. Failed image probe after ${maxRetries} retries.`)
if (hasError) throw new Error(`images.ts: Bad network connection. Failed image probe after ${maxRetries} retries for url: ${url}.`)
if (0 === width + height) return null

setCache(cacheKey, { width, height })
Expand Down

1 comment on commit c8fc100

@vercel
Copy link

@vercel vercel bot commented on c8fc100 Jan 7, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.