Wrap Odoo auth in try block

This commit is contained in:
Timothée Floure 2021-04-07 17:24:21 +02:00
parent 7e6439be67
commit 65c9c07297
Signed by: tfloure
GPG key ID: 4502C902C00A1E12

View file

@ -32,6 +32,7 @@ defmodule RecycledCloud.Odoo do
nil
]
try do
auth_response = %XMLRPC.MethodCall{method_name: "authenticate", params: auth_params}
|> post!(@common_endpoint)
case auth_response do
@ -39,6 +40,8 @@ defmodule RecycledCloud.Odoo do
{:ok, uid} -> {:ok, uid}
{:error, err} -> {:error, err}
end
rescue e -> {:error, e}
end
end
defp check_odoo_config(key) do