hopp/examples/chat/error.go

12 lines
276 B
Go

package chat
import "fmt"
func (msg *MessageError) Error() string {
if description, ok := msg.Description.Value(); ok {
return fmt.Sprintf("other party sent error: %d %s", msg.Code, description)
} else {
return fmt.Sprintf("other party sent error: %d", msg.Code)
}
}