Closed omar-faruk-sust closed 5 years ago
Hi @omar-faruk-sust , if it's an exception that means "invalid user input" you can use BadRequestException https://github.com/upwork/phystrix/blob/master/library/Odesk/Phystrix/Exception/BadRequestException.php#L22
If you extend your exception from this class it will re-thrown as is. It will not be counted in metrics as a server error and it will not trigger the circuit breaker logic.
hi @lcf ,
If the exceptions are not BadRequestException
, how i can skip them of re throwing them? I saw that BadRequestException
is re-throwing as it is. I need to skip re-throwing my custom exceptions. Particularly my exception is falling into failed retrieving fallback
(EVENT_FALLBACK_FAILURE
) error criteria according to your implementation. Any suggestion how i can translate this error into my custom exception?
@omar-faruk-sust you can just extend your custom exceptions from BadRequestException like this:
class MyCustomException extends BadRequestException
Hello @lcf ,
I am facing an issue of using Phystrix in a project in a particular situation.
Let say, i have some custom (validation, some others) on my execution path. Without circuit breaker it's working good. I have implemented circuit breaker and those exception catch through circuit breaker and re-throwing them.
However what i have tried is, i was checking my custom exception(for example:
ExceptionA
) on fallback and translate this exception into another exception namedExeptionB
and want to throw it (which i want to make as a behaviour in case ofExceptionA
)what i notice is that, it's actually re-throwing the
ExceptionA
again instead ofExceptionB
which i don't want.so, is there any suggestion in this particular situation how to protect my custom exceptions and/or translate my exception to another and throw my new exception?