microsoft / tsyringe

Lightweight dependency injection container for JavaScript/TypeScript
MIT License
5.18k stars 172 forks source link

CustomError instanceof not working #214

Open hortelanobruno-ol opened 2 years ago

hortelanobruno-ol commented 2 years ago

Describe the bug

When we throw a CustomError on a function of a service that is injected usingtsyring and then we do an instanceof of that error the result is "error " instead of the CustomErrorClass.

We are using "tsyringe": "^4.7.0" and "typescript": "^4.7.4"