lib/esplanade/response/error.rb in esplanade-1.5.0 vs lib/esplanade/response/error.rb in esplanade-1.6.0

- old
+ new

@@ -1,34 +1,39 @@ module Esplanade class Response class Error < Esplanade::Error; end + class PrefixNotMatch < Error; end + class NotDocumented < Error def initialize(request:, status:) @method = request[:method] @path = request[:path] + @raw_path = request[:raw_path] @status = status super(to_hash) end def to_hash { request: { method: @method, - path: @path + path: @path, + raw_path: @raw_path }, status: @status } end end class BodyIsNotJson < Error def initialize(request:, status:, body:) @method = request[:method] @path = request[:path] + @raw_path = request[:raw_path] @status = status @body = body super(to_hash) end @@ -36,11 +41,12 @@ def to_hash { request: { method: @method, - path: @path + path: @path, + raw_path: @raw_path }, status: @status, body: @body } end @@ -48,10 +54,11 @@ class Invalid < Error def initialize(request:, status:, body:, error:) @method = request[:method] @path = request[:path] + @raw_path = request[:raw_path] @status = status @body = body @error = error super(to_hash) @@ -60,10 +67,11 @@ def to_hash { request: { method: @method, - path: @path + path: @path, + raw_path: @raw_path }, status: @status, body: @body, error: @error }