Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-10334

Inadequate information for handling catch clauses

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.12
    • None
    • Security Level: Public (Anyone can view this level - this is the default.)

    Description

      Their are some situations that different exception types are caught, but the handling of those exceptions can not show the differences of those types. Here are the code snippets we found which have this problem:

      cloudstack/server/src/main/java/com/cloud/api/dispatch/ParamProcessWorker.java

      https://github.com/apache/cloudstack/blob/893a88d225276e45f12f9490e6af2c94a81c2965/server/src/main/java/com/cloud/api/dispatch/ParamProcessWorker.java

      At Line 261 and Line 265. We can see that two exception types are caught, but the logging statements here can not show the exception type at all.

      Also they threw new exceptions after the logs, but the throw statements in these two catch clauses are identical, which are not distinguishable.

      It may cause confusions to the person who is reading the log, the person can not know what exception happened here and can not distinguish logs generated by these two statements.

       Maybe adding stack trace information to these two logging statements and change the log message to handle specific situations is a simple way to improve it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lzh3636 Zhenhao Li
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: