jaredhanson / electrolyte

Elegant dependency injection for Node.js.
MIT License
564 stars 61 forks source link

More expressive Error stack : ComponentNotFoundError #71

Open piercus opened 6 years ago

piercus commented 6 years ago

Hello,

Thank you for this lib.

before

        » An unexpected error was caught: Error 
      at /.../electrolyte/lib/container.js:187:18 

after

        » An unexpected error was caught: ComponentNotFoundError: Unable to create component 'parent' required by 'child' 
      at ComponentNotFoundError (/.../electrolyte/lib/errors/componentnotfound.js:7:20) 

I've followed https://stackoverflow.com/questions/783818/how-do-i-create-a-custom-error-in-javascript

coveralls commented 6 years ago

Coverage Status

Coverage increased (+2.0%) to 95.517% when pulling 475581bccd2cfda62af34076055a489b2f10b4e5 on piercus:expressive-error-stack into d6af75b444e8c46bd62c2eb2b708b73af3145e62 on jaredhanson:master.