# Unit Testing HTTP Client error response

**URL:** <https://forum.elixirforum.com/t/unit-testing-http-client-error-response/47952>\
**Category:** Questions\
**Tags:** http\_client, testing, httpoison\
**Created:** [May 24, 2022, 6:22pm UTC](https://forum.elixirforum.com/t/unit-testing-http-client-error-response/47952 "2022-05-24T18:22:09Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Bounti](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/6bbea6/32.png) [@Bounti](https://forum.elixirforum.com/u/Bounti)\
**Post date:** [May 24, 2022, 8:08pm UTC](https://forum.elixirforum.com/t/unit-testing-http-client-error-response/47952/5 "2022-05-24T20:08:07Z")

</div>

Thanks for the reply.

I learnt something new reading that!

However, I did use the exVCR stub functionality and creating custom cassettes. However, I need to test on the {:error, \_} match from the `HTTPoison.get` response not the details of the response itself.

I guess the above methods I originally mentioned are the only ways unless I change the interface for the API, ie just returning the `HTTPoison.response` instead of the `html`

---

_[View the full topic](https://forum.elixirforum.com/t/unit-testing-http-client-error-response/47952)._
