Sha256: e3d371572cce53bd301468a5bc23154b2f9b50dc80935fd0794bc0f756c93420

Contents?: true

Size: 455 Bytes

Versions: 24

Compression:

Stored size: 455 Bytes

Contents

require 'grape'

class GrapeSimple < Grape::API
  rescue_from :all do |e|
    error_response({ message: "rescued from #{e.class.name}" })
  end

  get '/json_endpoint' do
    present({ :test => true })
  end

  get "/break" do
    raise Exception.new("This should have http status code 500!")
  end

  get "/error" do
    error!("This is a error with 'error'!")
  end

  get "/breakstring" do
    raise "This should have http status code 500!"
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
traceview-3.0.2-java test/frameworks/apps/grape_simple.rb
traceview-3.0.2 test/frameworks/apps/grape_simple.rb
traceview-3.0.1-java test/frameworks/apps/grape_simple.rb
traceview-3.0.1 test/frameworks/apps/grape_simple.rb
traceview-3.0.0-java test/frameworks/apps/grape_simple.rb
traceview-3.0.0 test/frameworks/apps/grape_simple.rb
oboe-2.7.19-java test/frameworks/apps/grape_simple.rb
oboe-2.7.19 test/frameworks/apps/grape_simple.rb
oboe-2.7.18-java test/frameworks/apps/grape_simple.rb
oboe-2.7.18 test/frameworks/apps/grape_simple.rb
oboe-2.7.17.1-java test/frameworks/apps/grape_simple.rb
oboe-2.7.17.1 test/frameworks/apps/grape_simple.rb
oboe-2.7.16.1 test/frameworks/apps/grape_simple.rb
oboe-2.7.16.1-java test/frameworks/apps/grape_simple.rb
oboe-2.7.15.1-java test/frameworks/apps/grape_simple.rb
oboe-2.7.15.1 test/frameworks/apps/grape_simple.rb
oboe-2.7.14.1-java test/frameworks/apps/grape_simple.rb
oboe-2.7.14.1 test/frameworks/apps/grape_simple.rb
oboe-2.7.13.3-java test/frameworks/apps/grape_simple.rb
oboe-2.7.13.3 test/frameworks/apps/grape_simple.rb