Comments (5)
Do you have to pattern match on the exception name? HTTPoison
only has one exception type. This would also work...
{:error, %{reason: reason}} = response
I'll look into mirroring the Error
struct but this ^ might fix it for you too
from elixir_agent.
summarizing, we have 3 options:
- first
alias NewRelic.Instrumented.HTTPoison, as: NRHTTPoison
and then: NRHTTPoison.post(...)
- second
case response do
{:error, {reason: reason}} ->
...
{:ok, {status_code: status, body: body}} ->
case status do
200 ->
...
_ ->
...
end
end
- third
case response do
{:error, %Elixir.HTTPoison.Error{reason: reason}} ->
...
{:ok, %Elixir.HTTPoison.Response{status_code: status, body: body}} ->
case status do
200 ->
...
_ ->
...
end
end
I liked the third option, modifying the documentation should help, and I think mirroring the struts won't be necessary, what do you think?
from elixir_agent.
I'll update the docs to point folks to the 2nd and 3rd option based on their preferences.
Thanks for reporting this!
from elixir_agent.
Thanks we'll look into how to solve this
from elixir_agent.
One thing you can do is reference the top level module via Elixir.
like this:
{:error, %Elixir.HTTPoison.Error{}} = HTTPoison.get("localhost:12345")
from elixir_agent.
Related Issues (20)
- Incompatible with Elixir 1.8.x HOT 1
- DistributedTrace.generate_sampling timeouts. HOT 1
- Long poll requests HOT 1
- Allow Configuration of CA Certificates HOT 3
- Provide Notice Errors in Elixir Agent HOT 3
- Connection timeout connecting to `collector.eu01.nr-data.net` HOT 12
- Connect timeout to the collector should be higher
- Log context break HOT 1
- Transactions often report wrong LiveView HOT 2
- Dumb question about crashes HOT 2
- Bad attribute on redis encoded string HOT 3
- Making Distributed Tracing configurable HOT 10
- Proxy configuration
- ~100mb memory usage when idle HOT 1
- Need some way to config the default log level
- Is Bandit HTTP server supported?
- Errors not recorded since upgrading to Elixir 1.15 HOT 4
- Phoenix LiveView metrics identified as Phoenix.LiveView.Plug
- Error parsing error info in logger translator HOT 7
- Failed to send harvest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elixir_agent.