Sha256: 6781f4ed44f4a394b2848b6e9ed6cdee5d40343ebcca909233255982bd863193

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

# Copyright (c) 2016 SolarWinds, LLC.
# 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

5 entries across 5 versions & 2 rubygems

Version Path
appoptics_apm-4.0.3 test/frameworks/apps/grape_nested.rb
appoptics_apm-4.0.2 test/frameworks/apps/grape_nested.rb
appoptics_apm-4.0.1-x86_64-linux test/frameworks/apps/grape_nested.rb
traceview-3.8.4-java test/frameworks/apps/grape_nested.rb
traceview-3.8.4 test/frameworks/apps/grape_nested.rb