improve error messages

- treat validation errors of the result of write_ and read_ messages
  properly
- add info about the called read_* and write_ methods to the error
  message, in case the error is not raised in the outmost method
- as subsequent errors in poll functions are logged only once, log an
  info when a poll function succeeds again
- remove DiscouragedConversion error

Change-Id: Ib66e001cc95de8225751a1464a92594c369ceb3f
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30788
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2023-03-24 17:22:02 +01:00
parent df8bc1c203
commit d0af831b1f
5 changed files with 127 additions and 98 deletions

View File

@ -23,7 +23,7 @@
import pytest
from frappy.errors import RangeError, WrongTypeError, ProgrammingError, \
ConfigError, InternalError, DiscouragedConversion, secop_error, make_secop_error
ConfigError, InternalError, TimeoutSECoPError, secop_error, make_secop_error
@pytest.mark.parametrize('exc, name, text, echk', [
@ -32,7 +32,7 @@ from frappy.errors import RangeError, WrongTypeError, ProgrammingError, \
(ProgrammingError('x'), 'InternalError', 'ProgrammingError: x', None),
(ConfigError('y'), 'InternalError', 'ConfigError: y', None),
(InternalError('z'), 'InternalError', 'z', None),
(DiscouragedConversion('w'), 'InternalError', 'DiscouragedConversion: w', None),
(TimeoutSECoPError('t'), 'TimeoutError', 't', None),
(ValueError('v'), 'InternalError', "ValueError: v", InternalError("ValueError: v")),
(None, 'InternalError', "UnknownError: v", InternalError("UnknownError: v")),
])