Uploaded image for project: 'Commons Crypto'
  1. Commons Crypto
  2. CRYPTO-95

Code should never catch Throwable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0
    • None
    • None

    Description

      As a general rule, code should never catch Throwable or Error, only Exception.

      Sometimes it is necessary to catch more than just Exception, but if so, the code must be careful to rethrow certain errors, e.g.

      ThreadDeath
      VirtualMachineError

      There may be some others

      If the throwable is not logged, then it's vital to ensure that only the appropriate ones are swallowed.

      But it is better to be explicit and only catch errors which are safe to handle.

      Attachments

        Activity

          People

            sebb Sebb
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: