Skip to content

Commit

Permalink
Merge pull request #400 from RodolpheDuge/master
Browse files Browse the repository at this point in the history
Quota error handling on bdp request
  • Loading branch information
eddelbuettel authored Dec 4, 2024
2 parents 0c1424a + 53c1d6b commit 9ffe10e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
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

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

0 comments on commit 9ffe10e

Please sign in to comment.