Skip to content

Commit

Permalink
Better error handling in getCtsKey
Browse files Browse the repository at this point in the history
  • Loading branch information
sneumann committed Oct 21, 2020
1 parent 9033bc4 commit 0010155
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: RMassBank
Type: Package
Title: Workflow to process tandem MS files and build MassBank records
Version: 2.99.2
Version: 2.99.3
Authors@R: c(
person(given = "RMassBank at Eawag", email = "massbank@eawag.ch",
role=c("cre")),
Expand Down
6 changes: 5 additions & 1 deletion R/webAccess.R
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ getCtsKey <- function(query, from = "Chemical Name", to = "InChIKey")
warning("CTS seems to be currently unavailable or incapable of interpreting your request")
return(NULL)
}


if(res$status_code != 200){
warning(paste("CTS has return code", res$status_code))
return(NULL)
}

r <- fromJSON(data)
if(length(r) == 0)
Expand Down

0 comments on commit 0010155

Please # to comment.