refactor error messages

pull/432/head
Darien Raymond 2017-04-03 13:07:12 +02:00
parent 72d9cb8a74
commit c4ba853887
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 1 deletions

View File

@ -114,7 +114,7 @@ func (f FrameMetadata) AsSupplier() buf.Supplier {
func ReadFrameFrom(b []byte) (*FrameMetadata, error) {
if len(b) < 4 {
return nil, errors.New("Proxyman|Mux: Insufficient buffer.")
return nil, errors.New("Proxyman|Mux: Insufficient buffer: ", len(b))
}
f := &FrameMetadata{
@ -151,6 +151,8 @@ func ReadFrameFrom(b []byte) (*FrameMetadata, error) {
f.Target = net.TCPDestination(addr, port)
case TargetNetworkUDP:
f.Target = net.UDPDestination(addr, port)
default:
return nil, errors.New("Proxymann|Mux: Unknown network type: ", network)
}
}