Rblp / Rblpapi

R package interfacing the Bloomberg API from https://www.bloomberglabs.com/api/
Other
166 stars 75 forks source link

Better error-handling #339

Open johnlaing opened 3 years ago

johnlaing commented 3 years ago

We should catch error messages passed back to us by the API. It would be particularly helpful to capture the message and show it to the user. The status quo of ignoring API error messages often causes a real error (the kind that stops execution) just down the line, except now with a cryptic message that doesn't shed much light on what went wrong.

Such an example is here: https://github.com/Rblp/Rblpapi/issues/338#issuecomment-835261565

eddelbuettel commented 3 years ago

It's been a while since I have been in the code but ... what can we do in general? Do we get earlier status messages?

eddelbuettel commented 3 years ago

Looking at #338 we can probably just Rcpp::stop( txtOfTheReceivedErrorMessage ) which then goes to the top R prompt.

johnlaing commented 3 years ago

Yes, something like that should work. We'll need to figure out how to identify/grab the responseError to get to it.