diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-06-06 19:48:48 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-06-06 19:48:48 +0200 |
commit | db2abd5ff62d881b3fecd7a2012bd54c55c6c42c (patch) | |
tree | 931a6e51753822b10f668c3a16907d2517077548 | |
parent | 5c1340a7940e55dcf39fc854bcd82fe747d5a7c0 (diff) |
replace 402 with 400 and halt with raise
-rw-r--r-- | application.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/application.rb b/application.rb index 5fbb749..2967d95 100644 --- a/application.rb +++ b/application.rb @@ -194,7 +194,7 @@ put '/:id/:hasStatus/?' do case params[:hasStatus] when "Completed" LOGGER.debug "Task " + params[:id].to_s + " completed" - halt 402,"no param resultURI when completing task" unless params[:resultURI] + raise OpenTox::BadRequestError.new"no param resultURI when completing task" unless params[:resultURI] task.resultURI = params[:resultURI] task.finished_at = DateTime.now task.percentageCompleted = 100 @@ -221,7 +221,7 @@ put '/:id/:hasStatus/?' do Process.kill(9,task.pid.to_i) unless task.pid.nil? task.pid = nil else - halt 402,"Invalid value for hasStatus: '"+params[:hasStatus].to_s+"'" + raise OpenTox::BadRequestError.new"Invalid value for hasStatus: '"+params[:hasStatus].to_s+"'" end raise"could not save task" unless task.save |