(err: Error | RollupError)
| 9 | import { CLIENT_PUBLIC_PATH } from '../../constants' |
| 10 | |
| 11 | export function prepareError(err: Error | RollupError): ErrorPayload['err'] { |
| 12 | // only copy the information we need and avoid serializing unnecessary |
| 13 | // properties, since some errors may attach full objects (e.g. PostCSS) |
| 14 | return { |
| 15 | message: strip(err.message), |
| 16 | stack: strip(cleanStack(err.stack || '')), |
| 17 | id: (err as RollupError).id, |
| 18 | frame: strip((err as RollupError).frame || ''), |
| 19 | plugin: (err as RollupError).plugin, |
| 20 | pluginCode: (err as RollupError).pluginCode?.toString(), |
| 21 | loc: (err as RollupError).loc, |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | export function buildErrorMessage( |
| 26 | err: RollupError, |
no test coverage detected