icarus-consulting / Yaapii.Http

C# Library for Http Request
MIT License
7 stars 0 forks source link

ExpectedStatus always builds Exception #48

Closed DFU398 closed 4 years ago

DFU398 commented 4 years ago

Expected Behavior

The function that creates an Exception is only called, when an Exception is needed.

Actual Behavior

The function that creates an Exception to throw, if the status doesn't match, is always called, even when the status matches.

Mention any other details that might be useful

Yaapii.Atoms.FailWhen takes an exception, so the Func is being executed to build FailWhen from the result. Use an if statement instead of FailWhen and only execute the Func when needed.

Steps to reproduce the behavior

The log given by the failure.