Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
The current logic which checks 'isFailure' in 'CircuitBreakerImpl.apply' 'case Left(e) if isFailure.isDefinedAt(e) => ZIO.fail(e)' isn't accomplishing the desired result and in almost all cases will return 'false'. The reason is that 'isDefinedAt' only checks if 'e' is covered within the domain of the 'PartialFunction', however it does not execute the logic of the partial function. instead 'applyOrElse' should be used to perform both operations: 'case Left(e) if isFailure.applyOrElse[E1, Boolean](e, _ => false) => ZIO.fail(e)' There is also a bug in the 'CircuitBreakerSpec' that is preventing the test from failing (the 'either' is in the wrong spot). Co-authored-by: Scott T Weaver <[email protected]>
- Loading branch information