Allow importing custom error types
- Lingua principale
- JavaScript
- Stelle
- 1.9k
- Fork
- 359
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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...
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.