Port of the Meteor.Error class from Meteor.
import * as Meteor from '@share911/meteor-error'
throw new Meteor.Error(500, 'Internal server error')
or
import { Error as MeteorError } from '@share911/meteor-error'
throw new MeteorError(500, 'Internal server error')