Skip to content

Latest commit

 

History

History

error

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@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