Error handling for Quandl API

200 views Asked by At

I'm using Quandl Ruby Client but sometimes it shows error that reason maybe when there is no code in Quandl.

Error message:

handle_api_error': (Status 404) (Quandl Error QECx02) You have submitted an incorrect Quandl code. Please check your Quandl codes and try again. (Quandl::NotFoundError)

My code:

data = Quandl::Dataset.get("TSE/7959").data( params: {limit:1})

I've already set api_key and api_version.

I read the library page but have no idea how to handle this error...

Does anyone have idea?

Thanks a lot!

1

There are 1 answers

0
T.Akashi On

I reolved this issue ruby's error handling.

begin
  data = Quandl::Dataset.get("TSE/7959").data( params: {limit:1})
  return data
rescure => e
  p e
end

Thank you!