Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-1950

Review DirectoryException hierarchy

    Details

    • Type: Task
    • Status: Done
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0, 2.6.2
    • Fix Version/s: Not applicable
    • Component/s: core server
    • Labels:
      None

      Description

      DirectoryException contains an additional resultCode field which give details about the exception.
      While we might want to keep this field, it might also be interesting to create exception inheriting from DirectoryException which, in addition to this result code, reflect more precisely the problem.

      Motivation is that there are some places where additional test using this result code are performed in catch(DirectoryException e) blocks while it might be better to use inheritance;

      Replacing:

      try {
      
      } catch(DirectoryException e) {
        if ( .getResultCode() == ResultCode.CONSTRAINT_VIOLATION) {
          ... do sthg ...
        } else {
          throw e; 
        }
      }
      

      By:

      try {
      
      } catch(ConstraintViolationException c) {
       .. Do sthg ...
      } catch(DirectoryException e) {
        throw e;
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                matthew Matthew Swift
                Reporter:
                ylecaillez Yannick Lecaillez
                Dev Assignee:
                Matthew Swift
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: