Sha256: 0041efb097caf8ccd5e882339946755f630a96c709b418fd32b324265e797fce

Contents?: true

Size: 644 Bytes

Versions: 40

Compression:

Stored size: 644 Bytes

Contents

# Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.

require 'grape'

class Wrapper < Grape::API
  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
end

class GrapeNested < Grape::API
  mount Wrapper::GrapeSimple
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
traceview-3.8.3-java test/frameworks/apps/grape_nested.rb
traceview-3.8.3 test/frameworks/apps/grape_nested.rb
traceview-3.8.2-java test/frameworks/apps/grape_nested.rb
traceview-3.8.2 test/frameworks/apps/grape_nested.rb
traceview-3.8.1-java test/frameworks/apps/grape_nested.rb
traceview-3.8.1 test/frameworks/apps/grape_nested.rb
traceview-3.8.0-java test/frameworks/apps/grape_nested.rb
traceview-3.8.0 test/frameworks/apps/grape_nested.rb
traceview-3.7.1-java test/frameworks/apps/grape_nested.rb
traceview-3.7.1 test/frameworks/apps/grape_nested.rb
traceview-3.7.0-java test/frameworks/apps/grape_nested.rb
traceview-3.7.0 test/frameworks/apps/grape_nested.rb
traceview-3.6.0-java test/frameworks/apps/grape_nested.rb
traceview-3.6.0 test/frameworks/apps/grape_nested.rb
traceview-3.5.1-java test/frameworks/apps/grape_nested.rb
traceview-3.5.1 test/frameworks/apps/grape_nested.rb
traceview-3.5.0-java test/frameworks/apps/grape_nested.rb
traceview-3.5.0 test/frameworks/apps/grape_nested.rb
traceview-3.4.2-java test/frameworks/apps/grape_nested.rb
traceview-3.4.2 test/frameworks/apps/grape_nested.rb