From a1e196ecbfcd40adbe6221c264adcf653a388d57 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 6 Jun 2011 16:54:56 +0000 Subject: halts (partially) substituted by OpenTox errors --- application.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application.rb') 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 -- cgit v1.2.3