mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
24033486b5
This improves how network errors (such as when the bundle analyzer error server is shut down) are shown. Fixes PACK-5877  
11 lines
295 B
TypeScript
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
|
|
}
|
|
}
|
|
}
|