Files
pnpm/packages/error
Zoltan Kochan 7ebe2a0532 fix: throw a meaningful error message on broken lockfile (#4387)
When `node-linker` is set to `hoisted`, a meaningful error message
should be thrown if the lockfile is broken and `pnpm install` is
executed.
2022-02-24 06:30:41 +02:00
..
2021-10-16 23:33:34 +03:00

@pnpm/error

An error class for pnpm errors

npm version

Installation

pnpm add @pnpm/error

Usage

import PnpmError from '@pnpm/error'

try {
    throw new PnpmError('THE_ERROR_CODE', 'The error message')
} catch (err: any) { // eslint-disable-line
    console.log(err.code)
    //> ERR_PNPM_THE_ERROR_CODE
    console.log(err.message)
    //> The error message
}

License

MIT