Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quota error handling on bdp request #400

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-11-25 Rodolphe Duge <[email protected]>

* src/bdp.c: Quota error handling on bdp request

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

2024-09-18 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): New release 0.3.15
Expand Down
13 changes: 13 additions & 0 deletions src/bdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ void getBDPResult(Event& event, Rcpp::List& res, const std::vector<std::string>&
if (std::strcmp(response.name().string(),"ReferenceDataResponse")) {
throw std::logic_error("Not a valid ReferenceDataResponse.");
}

const Name responseError("responseError");
if (response.hasElement(responseError)) {
Element errorElement = msg.getElement(responseError);
std::string errMsg("");
const Name messageTag("message");
if (errorElement.hasElement(messageTag)) {
errMsg = errorElement.getElementAsString(messageTag);
}
Rcpp::Rcerr << "REQUEST FAILED: " << errorElement << std::endl;
throw std::logic_error("bdp result: a responseError was received with message: (" + errMsg + ")");
}

Element securityData = response.getElement(Name{"securityData"});

for (size_t i = 0; i < securityData.numValues(); ++i) {
Expand Down
Loading