Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/protocol/http/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class Error < StandardError
class RefusedError < Error
end

# Raised when the remote endpoint fails while processing an HTTP stream or request.
# This error does not indicate whether application processing occurred. Where available, the protocol-specific error should be attached as the cause.
class RemoteError < Error
end

# @deprecated Use {RefusedError} instead.
RequestRefusedError = RefusedError

Expand Down
4 changes: 4 additions & 0 deletions releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Releases

## Unreleased

- Introduce `Protocol::HTTP::RemoteError` for remote endpoint failures where application processing may have occurred.

## v0.65.0

- Improve `Accept` header parsing for quoted pairs, malformed parameters, invalid wildcards, and invalid quality factors.
Expand Down
14 changes: 14 additions & 0 deletions test/protocol/http/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@
end
end

describe Protocol::HTTP::RemoteError do
let(:error) {subject.new("Remote endpoint encountered an internal error.")}

with "#initialize" do
it "is an HTTP error" do
expect(error).to be_a(Protocol::HTTP::Error)
end

it "has a descriptive message" do
expect(error.message).to be == "Remote endpoint encountered an internal error."
end
end
end

describe Protocol::HTTP::DuplicateHeaderError do
let(:key) {"content-length"}
let(:existing_value) {"100"}
Expand Down
Loading