I am still relatively new to python, and I am trying to read/catch/handle errors when using the Quandl api.
For example, if I type in a dataset that does not exist, I would like to "read" the error returned from the call, but as a newbie to python, I am not sure how to read the errors. The API document Quandl API shows HTTP errors and Quandl errors that I would like to be able to handle.
Here is a simple code sample that fails, and I am trying to read/catch/handle the error.
import pandas as pd
import Quandl as Q
df = Q.get("CME/PLZ2016")
The Traceback gives lots of details about the error and then has this section at the end:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\PyProj\Quandl\WorkingSampleQuandlDownload.py", line 7, in <module>
df = Q.get(exchsymbol, trim_start=strstartdate)
File "D:\Python33\lib\Quandl\Quandl.py", line 124, in get
raise DatasetNotFound(error)
Quandl.Quandl.DatasetNotFound: Dataset not found. Check Quandl code: CME/PLZ2016 for errors
If I use the try/exception, I get: Dataset not found. Check Quandl code: CME/PLZ2016 for errors
So, I would like to ask for your assistance in teaching me how to read/catch/handle the above error from Quandl. Hopefully I can learn how to find out the Quandl error and the HTTP status.
Thanks in advance.