summaryrefslogtreecommitdiff
path: root/application.rb
diff options
context:
space:
mode:
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