File: error.rb

package info (click to toggle)
ruby-protocol-http1 0.35.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 376 kB
  • sloc: ruby: 2,367; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 978 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.

require "protocol/http/error"

module Protocol
	module HTTP1
		# The base class for all HTTP/1.x errors.
		class Error < HTTP::Error
		end
		
		# The protocol was violated in some way, e.g. trying to write a request while reading a response.
		class ProtocolError < Error
		end
		
		# The request line was too long.
		class LineLengthError < Error
		end
		
		# The request was not able to be parsed correctly, or failed some kind of validation.
		class BadRequest < Error
		end
		
		# A header name or value was invalid, e.g. contains invalid characters.
		class BadHeader < BadRequest
		end
		
		# Indicates that the request is invalid for some reason, e.g. syntax error, invalid headers, etc.
		class InvalidRequest < BadRequest
		end
		
		# The specified content length and the given content's length do not match.
		class ContentLengthError < Error
		end
	end
end