Skip to content

Commit

Permalink
authenticate() : interface conversion: interface {} is bool, not int64 (
Browse files Browse the repository at this point in the history
#31)

Handle more properly authentication error
  • Loading branch information
edouard-claude authored Oct 12, 2021
1 parent e9a6cf6 commit 489798e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions odoo.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
var (
errClientConfigurationInvalid = errors.New("client configuration is invalid")
errClientNotAuthenticate = errors.New("client is not authenticate")
errClientAuthentication = errors.New("client authentication error: please verify client configuration")
)

// ClientConfig is the configuration to create a new *Client by givin connection infomations.
Expand Down Expand Up @@ -281,6 +282,9 @@ func (c *Client) authenticate() error {
if err != nil {
return err
}
if _, ok := resp.(bool); ok {
return errClientAuthentication
}
c.uid = resp.(int64)
c.auth = true
}
Expand Down

0 comments on commit 489798e

Please sign in to comment.