-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NewRelic.Instrumented.HTTPoison.Error.__struct__/0 is undefined, cannot expand struct NewRelic.Instrumented.HTTPoison.Error #26
Comments
Thanks we'll look into how to solve this |
Do you have to pattern match on the exception name? {:error, %{reason: reason}} = response I'll look into mirroring the |
One thing you can do is reference the top level module via {:error, %Elixir.HTTPoison.Error{}} = HTTPoison.get("localhost:12345") |
summarizing, we have 3 options:
I liked the third option, modifying the documentation should help, and I think mirroring the struts won't be necessary, what do you think? |
I'll update the docs to point folks to the 2nd and 3rd option based on their preferences. Thanks for reporting this! |
When using the
Pre-Instrumented Modules - HTTPoison
and doing pattern matching in HttpPoison response, eg.:it raises an error at compilation time:
NewRelic.Instrumented.HTTPoison.Error.__struct__/0 is undefined, cannot expand struct NewRelic.Instrumented.HTTPoison.Error
I don't know if there is a trick to do in
NewRelic.Instrumented.HTTPoison
to solve this error, I solved the problem using a different alias:alias NewRelic.Instrumented.HTTPoison, as: NRHTTPoison
and then:
NRHTTPoison.post(...)
but it looks ugly 😢
Environment
Elixir & Erlang version (
elixir -v
):Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.7.3 (compiled with Erlang/OTP 20)
Agent version (
mix deps | grep new_relic_agent
):new_relic_agent 1.0.2 (Hex package) (mix)
locked at 1.0.2 (new_relic_agent) 4528c139
The text was updated successfully, but these errors were encountered: