diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-02 19:33:54 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-02 19:33:54 +0100 |
commit | 387d3cfb7c150591f167bae16ca7f7128062aed8 (patch) | |
tree | 2695534b5ec3eb94a29d5e1fb9e2a352f9c32a80 /web/taginfo.rb | |
parent | 4ddaaeb4d6acb9d48be3ca48cc18daff7191fa8d (diff) | |
download | taginfo-387d3cfb7c150591f167bae16ca7f7128062aed8.tar taginfo-387d3cfb7c150591f167bae16ca7f7128062aed8.tar.gz |
Move paging parameter handling into new class
Diffstat (limited to 'web/taginfo.rb')
-rwxr-xr-x | web/taginfo.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/taginfo.rb b/web/taginfo.rb index 1f74141..6beadb7 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -45,7 +45,7 @@ require 'lib/language.rb' require 'lib/sql.rb' require 'lib/sources.rb' require 'lib/reports.rb' -require 'lib/apidoc.rb' +require 'lib/api.rb' require 'lib/langtag/bcp47.rb' #------------------------------------------------------------------------------ @@ -139,6 +139,11 @@ class Taginfo < Sinatra::Base content_type :json expires next_update headers['Access-Control-Allow-Origin'] = '*' + begin + @ap = APIParameters.new(params) + rescue ArgumentError => ex + halt 412, { :error => ex.message }.to_json + end end #------------------------------------- |