summaryrefslogtreecommitdiff
path: root/application.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-06-06 16:54:56 +0000
committerChristoph Helma <helma@in-silico.ch>2011-06-06 16:54:56 +0000
commita1e196ecbfcd40adbe6221c264adcf653a388d57 (patch)
tree89706459b25c09e25ecb1c4b0b901df07ec3dab0 /application.rb
parent83d51d8a56e138d6509b7d25e48eb6576fcd4b56 (diff)
halts (partially) substituted by OpenTox errors
Diffstat (limited to 'application.rb')
-rw-r--r--application.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/application.rb b/application.rb
index 6e1dcd7..c03d1b7 100644
--- a/application.rb
+++ b/application.rb
@@ -23,7 +23,7 @@ before do
@uri = uri @id
@yaml_file = "public/#{@id}.yaml"
- halt 404, "Model #{@id} not found." unless File.exists? @yaml_file
+ raise OpenTox::NotFoundError.new "Model #{@id} not found." unless File.exists? @yaml_file
end
# make sure subjectid is not included in params, subjectid is set as member variable
@@ -77,7 +77,7 @@ delete '/:id/?' do
response['Content-Type'] = 'text/plain'
"Model #{@id} deleted."
rescue
- halt 404, "Model #{@id} does not exist."
+ raise OpenTox::NotFoundError.new "Model #{@id} does not exist."
end
end