question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello,

I’m using circuit breaker to hold calls to some third party APIs and I have a doubt about if it’s possible to get the exception in fallback function, cause I’m using the axios library and every response that’s not a status code 200 throws an exception and calls the fallback, so I would like to personalize the fallback function based on this status code. Is this possible?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dayvsonsalescommented, Dec 21, 2020

@helio-frota thank you. It solved my problem. I had just to use error as the last parameter.


this.circuitRecommendByCity.fallback((cityName, err) => {
	return this.handleFallbackByCity(cityName, err);
});

I think it’d be great to have an example with this, cause I had to look at lib code to figure out that the last parameter is the error parameter.

0reactions
helio-frotacommented, Dec 21, 2020

@dayvsonsales feel free to send a PR to https://github.com/nodeshift-starters/opossum-playground/ 👍

Closing this since it was solved

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fallbacks Definition & Meaning - Merriam-Webster
The meaning of FALLBACK is something on which one can fall back : reserve —often used attributively. How to use fallback in a...
Read more >
IBOR Fallbacks Fact Sheet - Bloomberg Professional Services
The Fallback Rates each correspond to an 'Original IBOR Rate Record Day ', which is the date that the relevant IBOR would have...
Read more >
New IBOR Fallbacks Take Effect for Derivatives
The fallbacks, published by the International Swaps and Derivatives Association, Inc. (ISDA), will be incorporated into all new derivatives ...
Read more >
LIBOR Fallbacks In Focus: A Lesson In Unintended ...
Our report discusses the implications of the existing fallback language for LIBOR transition, and highlights actions that should be taken to mitigate the ......
Read more >
ISDA IBOR Fallbacks - HSBC Commercial Banking
The IBOR Fallbacks Supplement includes new contractual fallback provisions ('ISDA Fallbacks') that will take effect for derivatives contracts referencing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found