Skip to content
Snippets Groups Projects
Commit 77547263 authored by Achraf (abz)'s avatar Achraf (abz) Committed by Achraf
Browse files

[FIX] base: Update non-stored field error logging to include exc details

We have many issues with this log, except that with a `logger.error` we
do not have exception information (exc_info).

As mentionned in the documentation above, we cannot use `logger.exception`
in this case because we are not within an exception handler.
However, we can still retrieve the exception information using `sys`
module and the `exc_info()` method.

https://docs.python.org/3/library/logging.html#logging.Logger.exception
```
exception(msg, *args, **kwargs)
  ...
  This method should only be called from an exception handler.
```

https://docs.python.org/3/library/sys.html#sys.exc_info


```
sys.exc_info()
This function returns the old-style representation of the handled exception.
...
If no exception is being handled anywhere on the stack, this function
return a tuple containing three None values.
...
```

closes odoo/odoo#124177

X-original-commit: b0844d2f
Signed-off-by: default avatarChristophe Simonis (chs) <chs@odoo.com>
parent 5b854cb3
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment