summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-05-10 13:27:53 +0200
committermguetlein <martin.guetlein@gmail.com>2010-05-10 13:27:53 +0200
commit1298062bb4a8c1ecdb8d47b31047a33f0a79e6ce (patch)
tree03c485835e54b43e7c51fa00c1699fb49ba9f0fb
parent81c8fcfe718f005eb32ebd114f3817dd2a82673f (diff)
error msg for not existing tasks
-rw-r--r--application.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/application.rb b/application.rb
index 0f82931..cee3997 100644
--- a/application.rb
+++ b/application.rb
@@ -32,12 +32,12 @@ end
get '/:id/?' do
task = Task.get(params[:id])
+ halt 404, "Task '#{params[:id]}' not found." unless task
+
task_content = {:creator => task.creator, :title => task.title, :date => task.created_at.to_s, :hasStatus => task.hasStatus,
:resultURI => task.resultURI, :percentageCompleted => task.percentageCompleted, :description => task.description,
:due_to_time => task.due_to_time.to_s}
- halt 404, "Task #{params[:id]} not found." unless task
-
code = task.hasStatus == "Running" ? 202 : 200
case request.env['HTTP_ACCEPT']