Skip to content

Instantly share code, notes, and snippets.

@kenton
Created April 19, 2012 18:01
Show Gist options
  • Save kenton/2422666 to your computer and use it in GitHub Desktop.
Save kenton/2422666 to your computer and use it in GitHub Desktop.
# calling this curl command from command line
(@ondemand)(1282m|feature/ondemand-geogrid!?) ~limos $ curl http://localhost:3000/od/rate_card/from/37.7970456263422,-122.395925521724/\?token\=ABC123
# gives this response
# I edited the result returned when a generic exception is raised to also include the backtrace
{"error_message":"'NoMethodError',
'undefined method `lng' for \"37.7970456263422,-122.395925521724\":String',
/Users/kentonnewby/dev/limos/lib/ondemand/pricing/grid/geo_helpers.rb:18:in `latlng_to_point'
/Users/kentonnewby/dev/limos/lib/ondemand/pricing/geographic_shapes/lazy_grid_lookup.rb:35:in `find'
/Users/kentonnewby/dev/limos/lib/ondemand/pricing/rate_card.rb:26:in `get_pickup'
/Users/kentonnewby/dev/limos/lib/ondemand/pricing/ride/quote_ride.rb:55:in `nearby_places_rate_card'
/Users/kentonnewby/dev/limos/app/controllers/ondemand/rate_cards_controller.rb:37:in `new'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/kentonnewby/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/Users/kentonnewby/dev/limos/app/middlewares/api_mapper.rb:31:in `call'
/Users/kentonnewby/dev/limos/app/middlewares/api_mapper.rb:31:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rails-2.3.5/lib/rails/rack/metal.rb:47:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:122:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/rack.rb:27:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/user_informer.rb:12:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run'
/Users/kentonnewby/.rvm/gems/ruby-1.8.7-p334@ondemand/gems/rails-2.3.5/lib/commands/server.rb:111
script/server:3:in `require'
script/server:3","response_code":"404","nearest_airport_rates":[]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment