Inversifyjs: Error handling: loosing stacktrace

Created on 22 Nov 2017  路  5Comments  路  Source: inversify/InversifyJS

In the factoryWrapper function, an error is thrown with caught error.message, loosing stacktrace information.
I suggest instead re-throwing the error.

replace (src/syntax/binding_to_syntax.ts#L24)

 throw new Error(error.message);

with (src/syntax/binding_to_syntax.ts#L24)

 throw error:
Accepting PRs Your first PR bug

All 5 comments

Hi @sveinburne thanks for reporting this issue. Would you like to send a PR?

@remojansen I have spotted other occurrences of this pattern (throw new Error(error.message)).
Are you OK that I dig further and replace'em all in a PR ?

Yes that should be OK :+1:

@sveinburne I just released 4.5.2 馃帀

@remojansen Thanks a lot for your reactivity !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

remojansen picture remojansen  路  4Comments

stjepangolemac picture stjepangolemac  路  5Comments

jshearer picture jshearer  路  4Comments

matthewjh picture matthewjh  路  3Comments

remojansen picture remojansen  路  4Comments