Commit 0933e122 authored by Valentin Valls's avatar Valentin Valls

Fix problem with message system

parent 36c53370
...@@ -33,6 +33,7 @@ from typing import Optional ...@@ -33,6 +33,7 @@ from typing import Optional
import numpy import numpy
import enum import enum
import logging
import contextlib import contextlib
from silx.gui import qt from silx.gui import qt
...@@ -41,6 +42,9 @@ from .style_model import Style ...@@ -41,6 +42,9 @@ from .style_model import Style
from . import style_model from . import style_model
_logger = logging.getLogger(__name__)
class ChangeEventType(enum.Enum): class ChangeEventType(enum.Enum):
"""Enumerate the list of attributes which can emit a change event.""" """Enumerate the list of attributes which can emit a change event."""
...@@ -449,7 +453,17 @@ class ComputableMixIn: ...@@ -449,7 +453,17 @@ class ComputableMixIn:
try: try:
result = self.compute(scan) result = self.compute(scan)
except ComputeError as e: except ComputeError as e:
scan.setCacheValidation(self, self.version(), e.msg) try:
# FIXME: This messages should be stored at the same place
scan.setCacheValidation(self, self.version(), e.msg)
except KeyError:
_logger.error(
"Computation message lost: %s, %s, %s",
self,
self.version(),
e.msg,
)
result = e.result result = e.result
except Exception as e: except Exception as e:
scan.setCacheValidation( scan.setCacheValidation(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment