errhttp.PayloadTooLarge

master
Charles Iliya Krempeaux 2019-07-19 16:33:55 -07:00
parent cbc84c0126
commit 597db4e001
2 changed files with 46 additions and 0 deletions

32
payloadtoolarge.go 100644
View File

@ -0,0 +1,32 @@
package errhttp
type PayloadTooLarge interface {
ClientError
PayloadTooLarge()
}
type internalPayloadTooLarge struct {
err error
}
func PayloadTooLargeWrap(err error) error {
return internalPayloadTooLarge{
err:err,
}
}
func (receiver internalPayloadTooLarge) Error() string {
return receiver.err.Error()
}
func (receiver internalPayloadTooLarge) Err() error {
return receiver.err
}
func (internalPayloadTooLarge) ClientError() {
// Nothing here.
}
func (internalPayloadTooLarge) PayloadTooLarge() {
// Nothing here.
}

View File

@ -0,0 +1,14 @@
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.")
}
}