From 63e9b0fa48153f410eabc1160463cb5ea539a0ac Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 8 May 2009 14:40:20 -0700 Subject: 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 --- src/lib/http/request.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/lib/http/request.go') 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. -- cgit v1.2.3