# Handling the error "HTTP.ExceptionRequest.StatusError"

**URL:** <https://discourse.julialang.org/t/handling-the-error-http-exceptionrequest-statuserror/57777>\
**Category:** New to Julia\
**Created:** [March 23, 2021, 12:07pm UTC](https://discourse.julialang.org/t/handling-the-error-http-exceptionrequest-statuserror/57777 "2021-03-23T12:07:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)\
**Post date:** [March 23, 2021, 12:07pm UTC](https://discourse.julialang.org/t/handling-the-error-http-exceptionrequest-statuserror/57777/1 "2021-03-23T12:07:51Z")

</div>

In the process of getting price data from Yahoo Finance, sometimes a ticker is missing. In that case, I get the error HTTP.ExceptionRequest.StatusError

How do I handle this error such that, when it occurs, I can continue my script (in my case, go to the next ticker in my list of tickers)?

To get an idea of what I am trying to do …

```
if iserror(HTTP.get(address)) == false
   do stuff
else
   next
end

```

---

<div class="post-metadata">

**Author:** ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)\
**Post date:** [March 23, 2021, 12:23pm UTC](https://discourse.julialang.org/t/handling-the-error-http-exceptionrequest-statuserror/57777/2 "2021-03-23T12:23:15Z")

</div>

I think something like the following would work in my case:

```
try
    res = HTTP.get(address)
catch e
    println("That ticker does not exist on Yahoo!")
end

```

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 23, 2021, 12:31pm UTC](https://discourse.julialang.org/t/handling-the-error-http-exceptionrequest-statuserror/57777/3 "2021-03-23T12:31:41Z")

</div>

Yes, but also have you seen

> **[GitHub - JuliaQuant/MarketData.jl: Time series market data](https://github.com/JuliaQuant/MarketData.jl)**
>
> Time series market data. Contribute to JuliaQuant/MarketData.jl development by creating an account on GitHub.

Rather than reinventing the wheel with barebones HTTP requests?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [March 23, 2021, 12:53pm UTC](https://discourse.julialang.org/t/handling-the-error-http-exceptionrequest-statuserror/57777/4 "2021-03-23T12:53:40Z")

</div>

You can tell [HTTP.jl](https://github.com/JuliaWeb/HTTP.jl) not to throw `StatusError`s by passing `status_exception=false` as a keyword argument:

```julia
r = HTTP.get(url; status_exception=false)
HTTP.iserror(r)

```
