Files
vercel__next.js/apps/bundle-analyzer/lib/errors.ts
Will Binns-Smith 24033486b5 next-analyze: improve network error visuals (#86222)
This improves how network errors (such as when the bundle analyzer error server is shut down) are shown.

Fixes PACK-5877

![image.png](https://app.graphite.com/user-attachments/assets/69e57bb7-03ca-45ec-9816-f4bc512bfd58.png)

![image.png](https://app.graphite.com/user-attachments/assets/450ed52c-5368-49ee-a149-e7b17a8c21db.png)
2025-11-20 11:13:57 -08:00

11 lines
295 B
TypeScript

export class NetworkError extends Error {
constructor(message: string, options?: { cause?: unknown }) {
super(message)
this.name = 'NetworkError'
// Preserve error cause when supported
if (options && 'cause' in options) {
;(this as any).cause = options.cause
}
}
}