Fixing up some error handling
This commit is contained in:
parent
04f99b298f
commit
91036c918d
|
@ -201,7 +201,12 @@ func (r *Ricochet) Connect(from string, to string) error {
|
||||||
data, err = proto.Marshal(ahsPacket)
|
data, err = proto.Marshal(ahsPacket)
|
||||||
r.sendPacket(data, 1)
|
r.sendPacket(data, 1)
|
||||||
|
|
||||||
response, _ = r.getMessages()
|
response, err = r.getMessages()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
resultResponse, _ := r.decodePacket(response[0], AUTH)
|
resultResponse, _ := r.decodePacket(response[0], AUTH)
|
||||||
r.logger.Print("Received Result: ", resultResponse)
|
r.logger.Print("Received Result: ", resultResponse)
|
||||||
|
|
||||||
|
@ -288,6 +293,7 @@ func (r *Ricochet) negotiateVersion() error {
|
||||||
version[1] = 0x4D
|
version[1] = 0x4D
|
||||||
version[2] = 0x01
|
version[2] = 0x01
|
||||||
version[3] = 0x01
|
version[3] = 0x01
|
||||||
|
|
||||||
fmt.Fprintf(r.conn, "%s", version)
|
fmt.Fprintf(r.conn, "%s", version)
|
||||||
r.logger.Print("Negotiating Version ", version)
|
r.logger.Print("Negotiating Version ", version)
|
||||||
res, err := r.recv()
|
res, err := r.recv()
|
||||||
|
|
Loading…
Reference in New Issue