Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-7539

Catch GenericEntityException and GenericServiceException and other instead of Exception in Java classes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 16.11.01
    • Fix Version/s: 16.11.01
    • Component/s: ALL COMPONENTS
    • Labels:
      None

      Description

      There are many places in Java code when services are called or entity operations are performed, but GenericEntityException and GenericServiceException and other exceptions are not handled, instead higher level Exception is handled. Its best practice to handle detailed level exceptions.

      This is parent ticket, i will create child tickets for each component.

      There are no Sub-Tasks for this issue.

        Activity

        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        At revision: 1768636, thanks to the way it was written, I have used multiple catch blocks wherever it's possible, with GenericEntityException and GenericServiceException by using a regexp S/R in Eclipse and a little var exception name change.

        Of course we should try to use it when it's possible https://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html#multiple

        Show
        jacques.le.roux Jacques Le Roux added a comment - At revision: 1768636, thanks to the way it was written, I have used multiple catch blocks wherever it's possible, with GenericEntityException and GenericServiceException by using a regexp S/R in Eclipse and a little var exception name change. Of course we should try to use it when it's possible https://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html#multiple
        Hide
        arunpati Arun Patidar added a comment -

        All subtasks has been closed. Now closing this ticket as well.

        Thanks Amit Gadaley and Divesh Dutta for the contribution.

        Show
        arunpati Arun Patidar added a comment - All subtasks has been closed. Now closing this ticket as well. Thanks Amit Gadaley and Divesh Dutta for the contribution.
        Hide
        pfm.smits Pierre Smits added a comment -

        +1

        Show
        pfm.smits Pierre Smits added a comment - +1
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        +1

        Show
        jacques.le.roux Jacques Le Roux added a comment - +1

          People

          • Assignee:
            arunpati Arun Patidar
            Reporter:
            diveshdut Divesh Dutta
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development