Uploaded image for project: 'Hot Rod Native client'
  1. Hot Rod Native client
  2. HRCPP-150

Always catch exceptions as const

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.CR2
    • 6.0.2.Final
    • None
    • None

      All exceptions should be caught as const. With inconsistent use of const/non-const, rethrown exception is not caught in non-const handler. I am not so sure about the above, the problem (actually HRCPP-119) was in fact caused by HotRodClientException not inheriting from Exception.

      Also, for rethrowing exceptions use throw; (not throw e; - this causes the exception to be sliced to the caught type, blocking polymorphism)

              rvansa1@redhat.com Radim Vansa (Inactive)
              rvansa1@redhat.com Radim Vansa (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: