Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-9846

Improve handling of error messages

    Details

    • Story Points:
      1
    • Epic Link:
    • Sprint:
      Alert Production S17 - 3
    • Team:
      Alert Production

      Description

      astshim presently prints AST error messages to stderr. Improve this so that the messages and up as the text of exceptions, instead.

      This work requires the new AST capability of registering an error handler which has just been released.

        Attachments

          Activity

          Hide
          rowen Russell Owen added a comment -

          I implemented most suggested changes. I also found that the error message buffer was not getting emptied so I fixed that and added a test for that to test_object.py.

          Show
          rowen Russell Owen added a comment - I implemented most suggested changes. I also found that the error message buffer was not getting emptied so I fixed that and added a test for that to test_object.py .
          Hide
          krzys Krzysztof Findeisen added a comment -

          Looks good to me, although I can't offer an independent opinion on the implementation strategy. Some minor comments on GitHub.

          Show
          krzys Krzysztof Findeisen added a comment - Looks good to me, although I can't offer an independent opinion on the implementation strategy. Some minor comments on GitHub.
          Hide
          rowen Russell Owen added a comment -

          A small change that takes advantage of a new capability of AST. I believe my solution is safe and standards-compliant, but I would appreciate a sanity check on that. If you think of a cleaner solution I'd be interested.

          The one known failure mode is that the first AST error message could be printed to stderr using AST's default error handler, because astshim's error handler is not registered until the first call to `ast::assertOK`. However, I think it unlikely (because astshim calls `assertOK` often) and the consequences are minor.

          Show
          rowen Russell Owen added a comment - A small change that takes advantage of a new capability of AST. I believe my solution is safe and standards-compliant, but I would appreciate a sanity check on that. If you think of a cleaner solution I'd be interested. The one known failure mode is that the first AST error message could be printed to stderr using AST's default error handler, because astshim's error handler is not registered until the first call to `ast::assertOK`. However, I think it unlikely (because astshim calls `assertOK` often) and the consequences are minor.

            People

            • Assignee:
              rowen Russell Owen
              Reporter:
              rowen Russell Owen
              Reviewers:
              Krzysztof Findeisen
              Watchers:
              Jim Bosch, Krzysztof Findeisen, Russell Owen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel