$ npm install to-error
Turn anything to error
import toError from 'to-error' const err = toError(['err1', 'err2'])