Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
selesnow authored May 14, 2020
1 parent ea53ef7 commit 6f8e121
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions R/yadirGetReportFun.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,32 @@ yadirGetReportFun <-
xml_text() %>%
message(" > Error Detail")

if ( SkipErrors == FALSE ) stop(content(answer, "parsed","text/xml",encoding = "UTF-8") %>%
xml_find_all(xpath = ".//reports:ApiError//reports:errorDetail") %>%
xml_text() %>%
message(" > Error Detail"))

if ( SkipErrors == FALSE ) {

err_detail <- content(answer, "parsed","text/xml",encoding = "UTF-8") %>%
xml_find_all(xpath = ".//reports:ApiError//reports:errorDetail") %>%
xml_text()

stop(err_detail)
} else {
next
}
}

if(answer$status_code == 500){
packageStartupMessage(paste0(current_login," - ",xml_text(content(answer, "parsed","text/xml",encoding = "UTF-8"))))
packageStartupMessage("While generating the report an error occurred on the server. If for this report the error on the server occurred for the first time, try to generate a report again. If the error persists, contact support.")

if ( SkipErrors == FALSE ) stop(content(answer, "parsed","text/xml",encoding = "UTF-8") %>%
xml_find_all(xpath = ".//reports:ApiError//reports:errorDetail") %>%
xml_text() %>%
message(" > Error Detail"))

if ( SkipErrors == FALSE ) {

err_detail <- content(answer, "parsed","text/xml",encoding = "UTF-8") %>%
xml_find_all(xpath = ".//reports:ApiError//reports:errorDetail") %>%
xml_text()

stop(err_detail)
} else {
next
}
}

if(answer$status_code == 201){
Expand Down

0 comments on commit 6f8e121

Please sign in to comment.