errhttp.PayloadTooLarge
parent
cbc84c0126
commit
597db4e001
|
@ -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.
|
||||
}
|
|
@ -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.")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue