Skip to content

standard: Use error_report instead of logging

Valentin Valls requested to merge wa-error-report into master

Closes #4149 (closed)

Now the standard functions displays compact errors (reusing the existing code) instead of displaying the full backtrace.

The message allow to follow and display the full trace and know which motor it is about.

DEMO_SESSION [4]: config.get("bad_mot")
             ...: config.get("dis_mot")
             ...: config.get("nan_mot")
             ...: nan_mot.controller.bad_position = True
             ...: wa()
Current Positions: user
                   dial

  robx[mm]       roby         sx        sy    sz[mm]    slit_top    slit_bottom    slit_vertical_gap    slit_vertical_offset
----------  ---------  ---------  --------  --------  ----------  -------------  -------------------  ----------------------
  0.000000   0.000000   0.000000  0.000000  0.000000      0.0000        0.00000               0.0000                  0.0000
  0.000000   0.000000   0.000000  0.000000  0.000000     -0.0000        0.00000               0.0000                  0.0000

   bad_mot    dis_mot    nan_mot
----------  ---------  ---------
      !ERR      *DIS*       !ERR
      !ERR      *DIS*       !ERR

!!! === RuntimeError: Error on motor 'bad_mot': BAD POSITION === !!! ( for more details type cmd 'last_error(3)' )
!!! === RuntimeError: Error on motor 'nan_mot': BAD POSITION === !!! ( for more details type cmd 'last_error(4)' )
Edited by Valentin Valls

Merge request reports