Allow importing custom error types
Đang mở
- Ngôn ngữ chính
- JavaScript
- Star
- 1.9k
- Fork
- 359
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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...
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.