removed Err() method. deal with internal type fitting interface in another way (other than a unit test)

master
Charles Iliya Krempeaux 2023-08-14 05:03:00 -07:00
parent 593a440c11
commit 502ea33a84
70 changed files with 124 additions and 574 deletions

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalBadGateway{}
var _ BadGateway = internalBadGateway{}
var ErrBadGateway error = BadGatewayWrap(errors.New("Bad Gateway"))
type BadGateway interface {
@ -27,10 +30,6 @@ func (receiver internalBadGateway) Error() string {
return receiver.err.Error()
}
func (receiver internalBadGateway) Err() error {
return receiver.err
}
func (internalBadGateway) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalBadRequest{}
var _ BadRequest = internalBadRequest{}
var ErrBadRequest = BadRequestWrap(errors.New("Bad Request"))
type BadRequest interface {
@ -25,10 +28,6 @@ func (receiver internalBadRequest) Error() string {
return receiver.err.Error()
}
func (receiver internalBadRequest) Err() error {
return receiver.err
}
func (internalBadRequest) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestBadRequest(t *testing.T) {
var x BadRequest = internalBadRequest{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalConflict{}
var _ Conflict = internalConflict{}
var ErrConflict = ConflictWrap(errors.New("Conflict"))
type Conflict interface {
@ -25,10 +28,6 @@ func (receiver internalConflict) Error() string {
return receiver.err.Error()
}
func (receiver internalConflict) Err() error {
return receiver.err
}
func (internalConflict) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestConflict(t *testing.T) {
var x Conflict = internalConflict{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -2,7 +2,6 @@ package errhttp
type Error interface {
error
Err() error
ErrHTTP()
Unwrap() error
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalExpectationFailed{}
var _ ExpectationFailed = internalExpectationFailed{}
var ErrExpectationFailed error = ExpectationFailedWrap(errors.New("Expectation Failed"))
type ExpectationFailed interface {
@ -25,10 +28,6 @@ func (receiver internalExpectationFailed) Error() string {
return receiver.err.Error()
}
func (receiver internalExpectationFailed) Err() error {
return receiver.err
}
func (internalExpectationFailed) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestExpectationFailed(t *testing.T) {
var x ExpectationFailed = internalExpectationFailed{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalFailedDependency{}
var _ FailedDependency = internalFailedDependency{}
var ErrFailedDependency error = FailedDependencyWrap(errors.New("Failed Dependency"))
type FailedDependency interface {
@ -25,10 +28,6 @@ func (receiver internalFailedDependency) Error() string {
return receiver.err.Error()
}
func (receiver internalFailedDependency) Err() error {
return receiver.err
}
func (internalFailedDependency) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestFailedDependency(t *testing.T) {
var x FailedDependency = internalFailedDependency{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalForbidden{}
var _ Forbidden = internalForbidden{}
var ErrForbidden error = ForbiddenWrap(errors.New("Forbidden"))
type Forbidden interface {
@ -25,10 +28,6 @@ func (receiver internalForbidden) Error() string {
return receiver.err.Error()
}
func (receiver internalForbidden) Err() error {
return receiver.err
}
func (internalForbidden) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestForbidden(t *testing.T) {
var x Forbidden = internalForbidden{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalGatewayTimeout{}
var _ GatewayTimeout = internalGatewayTimeout{}
var ErrGatewayTimeout error = GatewayTimeoutWrap(errors.New("Gateway Timeout"))
type GatewayTimeout interface {
@ -27,10 +30,6 @@ func (receiver internalGatewayTimeout) Error() string {
return receiver.err.Error()
}
func (receiver internalGatewayTimeout) Err() error {
return receiver.err
}
func (internalGatewayTimeout) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalGone{}
var _ Gone = internalGone{}
var ErrGone error = GoneWrap(errors.New("Gone"))
type Gone interface {
@ -25,10 +28,6 @@ func (receiver internalGone) Error() string {
return receiver.err.Error()
}
func (receiver internalGone) Err() error {
return receiver.err
}
func (internalGone) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestGone(t *testing.T) {
var x Gone = internalGone{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalHTTPVersionNotSupported{}
var _ HTTPVersionNotSupported = internalHTTPVersionNotSupported{}
var ErrHTTPVersionNotSupported error = HTTPVersionNotSupportedWrap(errors.New("HTTP Version Not Supported"))
type HTTPVersionNotSupported interface {
@ -27,10 +30,6 @@ func (receiver internalHTTPVersionNotSupported) Error() string {
return receiver.err.Error()
}
func (receiver internalHTTPVersionNotSupported) Err() error {
return receiver.err
}
func (internalHTTPVersionNotSupported) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalInsufficientStorage{}
var _ InsufficientStorage = internalInsufficientStorage{}
var ErrInsufficientStorage error = InsufficientStorageWrap(errors.New("Insufficient Storage"))
type InsufficientStorage interface {
@ -27,10 +30,6 @@ func (receiver internalInsufficientStorage) Error() string {
return receiver.err.Error()
}
func (receiver internalInsufficientStorage) Err() error {
return receiver.err
}
func (internalInsufficientStorage) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalInternalServerError{}
var _ InternalServerError = internalInternalServerError{}
var ErrInternalServerError error = InternalServerErrorWrap(errors.New("Internal Server Error"))
type InternalServerError interface {
@ -27,10 +30,6 @@ func (receiver internalInternalServerError) Error() string {
return receiver.err.Error()
}
func (receiver internalInternalServerError) Err() error {
return receiver.err
}
func (internalInternalServerError) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalLengthRequired{}
var _ LengthRequired = internalLengthRequired{}
var ErrLengthRequired error = LengthRequiredWrap(errors.New("Length Required"))
type LengthRequired interface {
@ -25,10 +28,6 @@ func (receiver internalLengthRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalLengthRequired) Err() error {
return receiver.err
}
func (internalLengthRequired) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestLengthRequired(t *testing.T) {
var x LengthRequired = internalLengthRequired{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalLocked{}
var _ Locked = internalLocked{}
var ErrLocked error = LockedWrap(errors.New("Locked"))
type Locked interface {
@ -25,10 +28,6 @@ func (receiver internalLocked) Error() string {
return receiver.err.Error()
}
func (receiver internalLocked) Err() error {
return receiver.err
}
func (internalLocked) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestLocked(t *testing.T) {
var x Locked = internalLocked{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalLoopDetected{}
var _ LoopDetected = internalLoopDetected{}
var ErrLoopDetected error = LoopDetectedWrap(errors.New("Loop Detected"))
type LoopDetected interface {
@ -27,10 +30,6 @@ func (receiver internalLoopDetected) Error() string {
return receiver.err.Error()
}
func (receiver internalLoopDetected) Err() error {
return receiver.err
}
func (internalLoopDetected) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalMethodNotAllowed{}
var _ MethodNotAllowed = internalMethodNotAllowed{}
var ErrMethodNotAllowed error = MethodNotAllowedWrap(errors.New("Method Not Allowed"))
type MethodNotAllowed interface {
@ -25,10 +28,6 @@ func (receiver internalMethodNotAllowed) Error() string {
return receiver.err.Error()
}
func (receiver internalMethodNotAllowed) Err() error {
return receiver.err
}
func (internalMethodNotAllowed) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestMethodNotAllowed(t *testing.T) {
var x MethodNotAllowed = internalMethodNotAllowed{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalNetworkAuthenticationRequired{}
var _ NetworkAuthenticationRequired = internalNetworkAuthenticationRequired{}
var ErrNetworkAuthenticationRequired error = NetworkAuthenticationRequiredWrap(errors.New("Network Authentication Required"))
type NetworkAuthenticationRequired interface {
@ -27,10 +30,6 @@ func (receiver internalNetworkAuthenticationRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalNetworkAuthenticationRequired) Err() error {
return receiver.err
}
func (internalNetworkAuthenticationRequired) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalNotAcceptable{}
var _ NotAcceptable = internalNotAcceptable{}
var ErrNotAcceptable error = NotAcceptableWrap(errors.New("Not Acceptable"))
type NotAcceptable interface {
@ -25,10 +28,6 @@ func (receiver internalNotAcceptable) Error() string {
return receiver.err.Error()
}
func (receiver internalNotAcceptable) Err() error {
return receiver.err
}
func (internalNotAcceptable) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestNotAcceptable(t *testing.T) {
var x NotAcceptable = internalNotAcceptable{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalNotExtended{}
var _ NotExtended = internalNotExtended{}
var ErrNotExtended error = NotExtendedWrap(errors.New("Not Extended"))
type NotExtended interface {
@ -27,10 +30,6 @@ func (receiver internalNotExtended) Error() string {
return receiver.err.Error()
}
func (receiver internalNotExtended) Err() error {
return receiver.err
}
func (internalNotExtended) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalNotFound{}
var _ NotFound = internalNotFound{}
var ErrNotFound error = NotFoundWrap(errors.New("Not Found"))
type NotFound interface {
@ -25,10 +28,6 @@ func (receiver internalNotFound ) Error() string {
return receiver.err.Error()
}
func (receiver internalNotFound ) Err() error {
return receiver.err
}
func (internalNotFound ) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestNotFound(t *testing.T) {
var x NotFound = internalNotFound{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalNotImplemented{}
var _ NotImplemented = internalNotImplemented{}
var ErrNotImplemented error = NotImplementedWrap(errors.New("Not Implemented"))
type NotImplemented interface {
@ -27,10 +30,6 @@ func (receiver internalNotImplemented) Error() string {
return receiver.err.Error()
}
func (receiver internalNotImplemented) Err() error {
return receiver.err
}
func (internalNotImplemented) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalPayloadTooLarge{}
var _ PayloadTooLarge = internalPayloadTooLarge{}
var ErrPayloadTooLarge error = PayloadTooLargeWrap(errors.New("Payload Too Large"))
type PayloadTooLarge interface {
@ -25,10 +28,6 @@ func (receiver internalPayloadTooLarge) Error() string {
return receiver.err.Error()
}
func (receiver internalPayloadTooLarge) Err() error {
return receiver.err
}
func (internalPayloadTooLarge) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestPayloadTooLarge(t *testing.T) {
var x PayloadTooLarge = internalPayloadTooLarge{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalPaymentRequired{}
var _ PaymentRequired = internalPaymentRequired{}
var ErrPaymentRequired error = PaymentRequiredWrap(errors.New("Payment Required"))
type PaymentRequired interface {
@ -25,10 +28,6 @@ func (receiver internalPaymentRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalPaymentRequired) Err() error {
return receiver.err
}
func (internalPaymentRequired) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestPaymentRequired(t *testing.T) {
var x PaymentRequired = internalPaymentRequired{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalPreconditionFailed{}
var _ PreconditionFailed = internalPreconditionFailed{}
var ErrPreconditionFailed error = PreconditionFailedWrap(errors.New("Precondition Failed"))
type PreconditionFailed interface {
@ -25,10 +28,6 @@ func (receiver internalPreconditionFailed) Error() string {
return receiver.err.Error()
}
func (receiver internalPreconditionFailed) Err() error {
return receiver.err
}
func (internalPreconditionFailed) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestPreconditionFailed(t *testing.T) {
var x PreconditionFailed = internalPreconditionFailed{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalPreconditionRequired{}
var _ PreconditionRequired = internalPreconditionRequired{}
var ErrPreconditionRequired error = PreconditionRequiredWrap(errors.New("Precondition Required"))
type PreconditionRequired interface {
@ -25,10 +28,6 @@ func (receiver internalPreconditionRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalPreconditionRequired) Err() error {
return receiver.err
}
func (internalPreconditionRequired) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestPreconditionRequired(t *testing.T) {
var x PreconditionRequired = internalPreconditionRequired{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalProxyAuthRequired{}
var _ ProxyAuthRequired = internalProxyAuthRequired{}
var ErrProxyAuthRequired error = ProxyAuthRequiredWrap(errors.New("Proxy Auth Required"))
type ProxyAuthRequired interface {
@ -25,10 +28,6 @@ func (receiver internalProxyAuthRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalProxyAuthRequired) Err() error {
return receiver.err
}
func (internalProxyAuthRequired) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestProxyAuthRequired(t *testing.T) {
var x ProxyAuthRequired = internalProxyAuthRequired{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalRequestedRangeNotSatisfiable{}
var _ RequestedRangeNotSatisfiable = internalRequestedRangeNotSatisfiable{}
var ErrRequestedRangeNotSatisfiable error = RequestedRangeNotSatisfiableWrap(errors.New("Requested Range Not Satisfiable"))
type RequestedRangeNotSatisfiable interface {
@ -25,10 +28,6 @@ func (receiver internalRequestedRangeNotSatisfiable) Error() string {
return receiver.err.Error()
}
func (receiver internalRequestedRangeNotSatisfiable) Err() error {
return receiver.err
}
func (internalRequestedRangeNotSatisfiable) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestRequestedRangeNotSatisfiable(t *testing.T) {
var x RequestedRangeNotSatisfiable = internalRequestedRangeNotSatisfiable{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalRequestEntityTooLarge{}
var _ RequestEntityTooLarge = internalRequestEntityTooLarge{}
var ErrRequestEntityTooLarge error = RequestEntityTooLargeWrap(errors.New("Request Entity Too Large"))
type RequestEntityTooLarge interface {
@ -25,10 +28,6 @@ func (receiver internalRequestEntityTooLarge) Error() string {
return receiver.err.Error()
}
func (receiver internalRequestEntityTooLarge) Err() error {
return receiver.err
}
func (internalRequestEntityTooLarge) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestRequestEntityTooLarge(t *testing.T) {
var x RequestEntityTooLarge = internalRequestEntityTooLarge{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,11 +4,13 @@ import (
"errors"
)
var _ Error = internalRequestHeaderFieldsTooLarge{}
var _ RequestHeaderFieldsTooLarge = internalRequestHeaderFieldsTooLarge{}
var ErrRequestHeaderFieldsTooLarge error = RequestHeaderFieldsTooLargeWrap(errors.New("RequestHeaderFieldsTooLarge"))
type RequestHeaderFieldsTooLarge interface {
error
Err() error
ClientError
RequestHeaderFieldsTooLarge()
}
@ -26,10 +28,6 @@ func (receiver internalRequestHeaderFieldsTooLarge) Error() string {
return receiver.err.Error()
}
func (receiver internalRequestHeaderFieldsTooLarge) Err() error {
return receiver.err
}
func (internalRequestHeaderFieldsTooLarge) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestRequestHeaderFieldsTooLarge(t *testing.T) {
var x RequestHeaderFieldsTooLarge = internalRequestHeaderFieldsTooLarge{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,11 +4,13 @@ import (
"errors"
)
var _ Error = internalRequestTimeout{}
var _ RequestTimeout = internalRequestTimeout{}
var ErrRequestTimeout error = RequestTimeoutWrap(errors.New("Request Timeout"))
type RequestTimeout interface {
error
Err() error
ClientError
RequestTimeout()
}
@ -26,10 +28,6 @@ func (receiver internalRequestTimeout) Error() string {
return receiver.err.Error()
}
func (receiver internalRequestTimeout) Err() error {
return receiver.err
}
func (internalRequestTimeout) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestRequestTimeout(t *testing.T) {
var x RequestTimeout = internalRequestTimeout{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,11 +4,13 @@ import (
"errors"
)
var _ Error = internalRequestURITooLong{}
var _ RequestURITooLong = internalRequestURITooLong{}
var ErrRequestURITooLong error = RequestURITooLongWrap(errors.New("Request URI Too Long"))
type RequestURITooLong interface {
error
Err() error
ClientError
RequestURITooLong()
}
@ -26,10 +28,6 @@ func (receiver internalRequestURITooLong) Error() string {
return receiver.err.Error()
}
func (receiver internalRequestURITooLong) Err() error {
return receiver.err
}
func (internalRequestURITooLong) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestRequestURITooLong(t *testing.T) {
var x RequestURITooLong = internalRequestURITooLong{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalServiceUnavailable{}
var _ ServiceUnavailable = internalServiceUnavailable{}
var ErrServiceUnavailable error = ServiceUnavailableWrap(errors.New("Service Unavailable"))
type ServiceUnavailable interface {
@ -25,10 +28,6 @@ func (receiver internalServiceUnavailable) Error() string {
return receiver.err.Error()
}
func (receiver internalServiceUnavailable) Err() error {
return receiver.err
}
func (internalServiceUnavailable) ErrHTTP() {
// Nothing here.
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalTeapot{}
var _ Teapot = internalTeapot{}
var ErrTeapot error = TeapotWrap(errors.New("I'm a teapot"))
type Teapot interface {
@ -25,10 +28,6 @@ func (receiver internalTeapot) Error() string {
return receiver.err.Error()
}
func (receiver internalTeapot) Err() error {
return receiver.err
}
func (internalTeapot) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestTeapot(t *testing.T) {
var x Teapot = internalTeapot{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalTooManyRequests{}
var _ TooManyRequests = internalTooManyRequests{}
var ErrTooManyRequests error = TooManyRequestsWrap(errors.New("Too Many Requests"))
type TooManyRequests interface {
@ -25,10 +28,6 @@ func (receiver internalTooManyRequests) Error() string {
return receiver.err.Error()
}
func (receiver internalTooManyRequests) Err() error {
return receiver.err
}
func (internalTooManyRequests) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestTooManyRequests(t *testing.T) {
var x TooManyRequests = internalTooManyRequests{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalUnauthorized{}
var _ Unauthorized = internalUnauthorized{}
var ErrUnauthorized error = UnauthorizedWrap(errors.New("Unauthorized"))
type Unauthorized interface {
@ -25,10 +28,6 @@ func (receiver internalUnauthorized) Error() string {
return receiver.err.Error()
}
func (receiver internalUnauthorized) Err() error {
return receiver.err
}
func (internalUnauthorized) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestUnauthorized(t *testing.T) {
var x Unauthorized = internalUnauthorized{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalUnavailableForLegalReasons{}
var _ UnavailableForLegalReasons = internalUnavailableForLegalReasons{}
var ErrUnavailableForLegalReasons error = UnavailableForLegalReasonsWrap(errors.New("Unavailable For Legal Reasons"))
type UnavailableForLegalReasons interface {
@ -25,10 +28,6 @@ func (receiver internalUnavailableForLegalReasons) Error() string {
return receiver.err.Error()
}
func (receiver internalUnavailableForLegalReasons) Err() error {
return receiver.err
}
func (internalUnavailableForLegalReasons) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestUnavailableForLegalReasons(t *testing.T) {
var x UnavailableForLegalReasons = internalUnavailableForLegalReasons{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalUnprocessableEntity{}
var _ UnprocessableEntity = internalUnprocessableEntity{}
var ErrUnprocessableEntity error = UnprocessableEntityWrap(errors.New("Unprocessable Entity"))
type UnprocessableEntity interface {
@ -25,10 +28,6 @@ func (receiver internalUnprocessableEntity) Error() string {
return receiver.err.Error()
}
func (receiver internalUnprocessableEntity) Err() error {
return receiver.err
}
func (internalUnprocessableEntity) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestUnprocessableEntity(t *testing.T) {
var x UnprocessableEntity = internalUnprocessableEntity{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalUnsupportedMediaType{}
var _ UnsupportedMediaType = internalUnsupportedMediaType{}
var ErrUnsupportedMediaType error = UnsupportedMediaTypeWrap(errors.New("Unsupported Media Type"))
type UnsupportedMediaType interface {
@ -25,10 +28,6 @@ func (receiver internalUnsupportedMediaType) Error() string {
return receiver.err.Error()
}
func (receiver internalUnsupportedMediaType) Err() error {
return receiver.err
}
func (internalUnsupportedMediaType) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestUnsupportedMediaType(t *testing.T) {
var x UnsupportedMediaType = internalUnsupportedMediaType{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalUpgradeRequired{}
var _ UpgradeRequired = internalUpgradeRequired{}
var ErrUpgradeRequired error = UpgradeRequiredWrap(errors.New("Upgrade Required"))
type UpgradeRequired interface {
@ -25,10 +28,6 @@ func (receiver internalUpgradeRequired) Error() string {
return receiver.err.Error()
}
func (receiver internalUpgradeRequired) Err() error {
return receiver.err
}
func (internalUpgradeRequired) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestUpgradeRequired(t *testing.T) {
var x UpgradeRequired = internalUpgradeRequired{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalURITooLong{}
var _ URITooLong = internalURITooLong{}
var ErrURITooLong error = URITooLongWrap(errors.New("URI Too Long"))
type URITooLong interface {
@ -25,10 +28,6 @@ func (receiver internalURITooLong) Error() string {
return receiver.err.Error()
}
func (receiver internalURITooLong) Err() error {
return receiver.err
}
func (internalURITooLong) ErrHTTP() {
// Nothing here.
}

View File

@ -1,14 +0,0 @@
package errhttp
import (
"testing"
)
func TestURITooLong(t *testing.T) {
var x URITooLong = internalURITooLong{} // THIS IS THE LINE THAT ACTUALLY MATTERS IN THIS TEST.
if nil == x {
t.Errorf("This should not happen.")
}
}

View File

@ -4,6 +4,9 @@ import (
"errors"
)
var _ Error = internalVariantAlsoNegotiates{}
var _ VariantAlsoNegotiates = internalVariantAlsoNegotiates{}
var ErrVariantAlsoNegotiates error = VariantAlsoNegotiatesWrap(errors.New("Variant Also Negotiates"))
type VariantAlsoNegotiates interface {
@ -27,10 +30,6 @@ func (receiver internalVariantAlsoNegotiates) Error() string {
return receiver.err.Error()
}
func (receiver internalVariantAlsoNegotiates) Err() error {
return receiver.err
}
func (internalVariantAlsoNegotiates) ErrHTTP() {
// Nothing here.
}