Allow importing custom error types
Ouverte
- Langage dominant
- JavaScript
- Étoiles
- 1.9k
- Forks
- 359
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hi,
I am using node unit and I defined custom error types in this fashion :
```
var errors = {}
errors.UnknownAttributeError = function(message) {
this.name = "UnknownAttributeError";
this.message = message || "UnknownAttributeError";
}
errors.UnknownAttributeError.prototype = new Error();
errors.UnknownAttributeError.prototype.constructor = errors.UnknownAttributeError;
module.exports = errors;
```
when I import the errors file as so :
```
var Errors = require('./../../lib/relational/errors');
```
The `new Error()` is caught and raised, but I think it should not be...
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.