Skip to content

Commit

Permalink
Embellish unusual error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmallard committed Apr 12, 2017
1 parent 5de8a5b commit dd3ebeb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion reader.go
Expand Up @@ -17,6 +17,7 @@
package stompngo

import (
"encoding/hex"
"fmt"
"strconv"
"strings"
Expand Down Expand Up @@ -149,7 +150,8 @@ func (c *Connection) readFrame() (f Frame, e error) {

// Validate the command
if _, ok := validCmds[f.Command]; !ok {
return f, EINVBCMD
ev := fmt.Errorf("%s\n%s", EINVBCMD, hex.Dump([]byte(f.Command)))
return f, ev
}
// Read f.Headers
for {
Expand Down

0 comments on commit dd3ebeb

Please sign in to comment.