diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-05-14 16:06:34 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-05-14 16:06:34 +0200 |
commit | 3a52a6cda729b342c7b51a59ca3bb52a08bfb129 (patch) | |
tree | ac4d46aedc8513c86e5749908c9580a919ae9914 | |
parent | 6ea754fb00a284439d3bee5196301ab94d58ff1e (diff) |
check for task not found
-rw-r--r-- | application.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/application.rb b/application.rb index c5a5f0c..26ea4bc 100644 --- a/application.rb +++ b/application.rb @@ -58,7 +58,8 @@ end # dynamic access to Task properties get '/:id/:property/?' do response['Content-Type'] = 'text/plain' - task = Task.get(params[:id]) + task = Task.get(params[:id]) + halt 404,"Task #{params[:id]} not found." unless task eval("task.#{params[:property]}").to_s end |