diff options
author | Russ Cox <rsc@golang.org> | 2009-05-08 14:40:20 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-05-08 14:40:20 -0700 |
commit | 63e9b0fa48153f410eabc1160463cb5ea539a0ac (patch) | |
tree | 4109f593f086743b98c6b1143dec799b9127f9d0 /src/lib/http/request.go | |
parent | 556c85a7bf74e5c818a4c4926a7e89511bf4e08b (diff) | |
download | golang-63e9b0fa48153f410eabc1160463cb5ea539a0ac.tar.gz |
throw away os._Error.
make some error types in a few packages
R=r
DELTA=110 (25 added, 46 deleted, 39 changed)
OCL=28382
CL=28561
Diffstat (limited to 'src/lib/http/request.go')
-rw-r--r-- | src/lib/http/request.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/http/request.go b/src/lib/http/request.go index 3edaa4207..1173dd2a2 100644 --- a/src/lib/http/request.go +++ b/src/lib/http/request.go @@ -26,13 +26,16 @@ const ( ) // HTTP request parsing errors. +type ProtocolError struct { + os.ErrorString +} var ( - LineTooLong = os.NewError("http header line too long"); - ValueTooLong = os.NewError("http header value too long"); - HeaderTooLong = os.NewError("http header too long"); - BadHeader = os.NewError("malformed http header"); - BadRequest = os.NewError("invalid http request"); - BadHTTPVersion = os.NewError("unsupported http version"); + LineTooLong = &ProtocolError{"http header line too long"}; + ValueTooLong = &ProtocolError{"http header value too long"}; + HeaderTooLong = &ProtocolError{"http header too long"}; + BadHeader = &ProtocolError{"malformed http header"}; + BadRequest = &ProtocolError{"invalid http request"}; + BadHTTPVersion = &ProtocolError{"unsupported http version"}; ) // A Request represents a parsed HTTP request header. |