diff options
author | ch <ch@toxcreate.in-silico.ch> | 2010-05-28 12:24:12 +0200 |
---|---|---|
committer | ch <ch@toxcreate.in-silico.ch> | 2010-05-28 12:24:12 +0200 |
commit | 013dd9ea96501a12f28c7d52d8f47ad9febfbf9b (patch) | |
tree | 4c448397759c6a029639fa89e73d868836dabd89 | |
parent | 43a63d1231531c7b1346d74ba50631ce037c9e33 (diff) |
catching error during saving prediction dataset
-rw-r--r-- | lazar.rb | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -3,8 +3,6 @@ class Lazar < Model attr_accessor :prediction_dataset def classify(compound_uri,prediction) - - prediction.title += " lazar classification" lazar = YAML.load self.yaml compound = OpenTox::Compound.new(:uri => compound_uri) @@ -171,6 +169,7 @@ post '/:id/?' do # create prediction prediction = OpenTox::Dataset.new prediction.creator = lazar.uri prediction.title = URI.decode YAML.load(lazar.yaml).dependentVariables.split(/#/).last + prediction.title += " lazar classification" if compound_uri lazar.classify(compound_uri,prediction) unless lazar.database_activity?(compound_uri,prediction) @@ -191,7 +190,11 @@ elsif dataset_uri input_dataset.compounds.each do |compound_uri| lazar.classify(compound_uri,prediction) unless lazar.database_activity?(compound_uri,prediction) end - uri = prediction.save.chomp + begin + uri = prediction.save.chomp + rescue + halt 500, "Could not save prediction dataset" + end end halt 202,task_uri end |