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

          rowen Russell Owen created issue -
          rowen Russell Owen made changes -
          Field Original Value New Value
          Epic Link DM-9679 [ 30784 ]
          rowen Russell Owen made changes -
          Story Points 2 1
          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.
          rowen Russell Owen made changes -
          Reviewers Jim Bosch [ jbosch ]
          Status To Do [ 10001 ] In Review [ 10004 ]
          rowen Russell Owen made changes -
          Watchers Jim Bosch, Russell Owen [ Jim Bosch, Russell Owen ] Jim Bosch, Krzysztof Findeisen, Russell Owen [ Jim Bosch, Krzysztof Findeisen, Russell Owen ]
          rowen Russell Owen made changes -
          Reviewers Jim Bosch [ jbosch ] Krzysztof Findeisen [ krzys ]
          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.
          krzys Krzysztof Findeisen made changes -
          Status In Review [ 10004 ] Reviewed [ 10101 ]
          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 .
          rowen Russell Owen made changes -
          Resolution Done [ 10000 ]
          Status Reviewed [ 10101 ] Done [ 10002 ]

            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