Created
March 5, 2014 03:31
-
-
Save viruschidai/9360639 to your computer and use it in GitHub Desktop.
Node.js custom error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Base custom error class | |
exports.AbstractError = class AbstractError extends Error | |
constructor: (msg, constr) -> | |
Error.captureStackTrace this, constr or this | |
@message = msg or 'Error' | |
name: 'Abstract Error' | |
exports.InvalidDataError = class InvalidDataError extends AbstractError | |
name: 'Invalid Data Error' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment