overleaf/services/real-time/app/coffee/Errors.coffee

11 lines
260 B
CoffeeScript
Raw Normal View History

CodedError = (message, code) ->
error = new Error(message)
error.name = "CodedError"
error.code = code
error.__proto__ = CodedError.prototype
return error
CodedError.prototype.__proto__ = Error.prototype
module.exports = Errors =
CodedError: CodedError