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.

      1.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of accounting component Sub-task Closed Arun Patidar
       
      2.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of content component Sub-task Closed Arun Patidar
       
      3.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of manufacturing component Sub-task Closed Arun Patidar
       
      4.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of order component Sub-task Closed Arun Patidar
       
      5.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of party component Sub-task Closed Arun Patidar
       
      6.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of product component Sub-task Closed Arun Patidar
       
      7.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of workeffort component Sub-task Closed Arun Patidar
       
      8.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of framework component Sub-task Closed Arun Patidar
       
      9.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of framework/webtools component Sub-task Closed Arun Patidar
       
      10.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of specialpurpose/birt component Sub-task Closed Arun Patidar
       
      11.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of specialpurpose/ebay component Sub-task Closed Arun Patidar
       
      12.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of specialpurpose/ebaystore component Sub-task Closed Arun Patidar
       
      13.
      Catch GenericEntityException and GenericServiceException and other exceptions instead of Exception in Java classes of specialpurpose/solr component Sub-task Closed Arun Patidar
       

        Activity

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

        +1

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

        +1

        Show
        pfm.smits Pierre Smits added a comment - +1
        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
        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

          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