-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.6.0 breaks non-string errors #97
Comments
Thanks, @awolden In our use-case, message is the response from an upstream-service, and it needs to be processed. Even with the current fix, this breaks our implementation. |
|
The software in question is based on Loopback 2.x. While Error.message is defined as "user readable", i think that the output should remain untouched so it remains in a "known parseable" format. This should at least be an option. |
Where in the docs is it defined as "user readable"? It clearly says (FWIW, I agree we shouldn't break what worked before, but I don't buy that |
@SimenB you are correct, it's not defined as "human readable" - i read that between the lines. But that makes no difference for this issue. Concerning your "must be string"-argument: That being said: i still would love to see a feature-toggle/option. Otherwhise the change introduced in 2.6.0 marks a backwards-incompatible change, which should make the current version not 2.6.0, but 3.0.0. |
I fully support it behind an option 🙂 |
I agree an option flag is an easy implementation and guards against compatibility issues. I will can have a PR in tomorrow for the change unless @SimenB can get a PR in sooner. |
Brakes is trying to modify the errors thrown by the callbacks it wraps, thereby causing an error itself:
Might I suggest having another look at the Error's thrown by brakes? I'd start with introducing BrakesError extends Error { … }
CircuitBrokenError extends BrakesError { … }
TimeoutError extends BrakesError { … }
ExecutionError extends BrakesError { … } And for the original problem here I'd introduce |
2.6.0 introduced "Add the breaker name to circuit rejections".
This breaks existing installations where err.message is not a string:
"[Breaker: Basket] [object Object]" is not helpful. Please either check if err.message is a String, or make adding the circuit-name optional.
The text was updated successfully, but these errors were encountered: