icarus-consulting / Yaapii.Http

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

Improve error messages for missing response/request parts #49

Closed DFU398 closed 3 years ago

DFU398 commented 4 years ago

Expected Behavior

When extracting a part from a request or response using *.Of, and the part doesn't exist, an appropriate Exception is thrown. Example: Using Body.Of on a response that doesn't contain a body should throw an InvalidOperationException with a message like "Body not found"

Actual Behavior

a generic KeyNotFoundException is thrown

Mention any other details that might be useful

all *.Of classes are probably affected by this

Steps to reproduce the behavior

The log given by the failure.