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) } }