diff options
author | mr <mr@mrautenberg.de> | 2011-08-04 18:35:25 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-08-04 18:35:25 +0200 |
commit | 0ff17e212eddea188ca15ea8e050e1cf1dd8ee68 (patch) | |
tree | f0d29cb5100636c5ba5566895f2c86943bce9882 /application.rb | |
parent | 8662d0b2f43758d9dcbff753bdaea18775cd1877 (diff) | |
parent | 400f8a894bbd0f781735fd94e9707ef8ff8fc577 (diff) |
Merge branch 'release/v2.1.0'
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/application.rb b/application.rb index 96c6267..7d3de38 100644 --- a/application.rb +++ b/application.rb @@ -23,7 +23,7 @@ before do @uri = uri @id @yaml_file = "public/#{@id}.yaml" - halt 404, "Dataset #{@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 @@ -69,15 +69,15 @@ delete '/:id/?' do if @subjectid and !File.exists? @yaml_file and @uri begin res = OpenTox::Authorization.delete_policies_from_uri(@uri, @subjectid) - LOGGER.debug "Policy deleted for Dataset URI: #{@uri} with result: #{res}" + LOGGER.debug "Policy deleted for Model URI: #{@uri} with result: #{res}" rescue - LOGGER.warn "Policy delete error for Dataset URI: #{@uri}" + LOGGER.warn "Policy delete error for Model URI: #{@uri}" end end 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 |