Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1822

Intermediary parent for NoResult and NonUnique Exceptions


    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: ORM
    • Security Level: All
    • Labels:


      I would like to propose a intermediary parent for the NoResult and NonUnique Exceptions, that is not as high level as ORMEXception, something in between.

      The reasoning for this is that sometime si want to get a single object out of the DB, and in case its not there i want to just get a null and carry on. For this I usually need to catch both exceptions as both results might trigger me to do something else, like abort. In some cases i do need to treat each of these in its own way, but in some cases it does not matter to which side the error went, it only matters that its not the expected SingleResult. Catching a ORMException is not adequate as it may include other error which would need to be treated differently.

      My proposal would be like:

      ORMException -> NotExpectedResultException ->

      {NoResult, NonUnique}

      Just a more detailed grouping of exceptions. Does this sound like something possible, or am I just nuts?


        Rafael Dohms created issue -
        Guilherme Blanco added a comment - Fixed in
        Guilherme Blanco made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Benjamin Eberlei [ beberlei ] Guilherme Blanco [ guilhermeblanco ]
        Fix Version/s 2.3 [ 10185 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13703 ] jira-feedback [ 15345 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15345 ] jira-feedback2 [ 17209 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17209 ] jira-feedback3 [ 19464 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to failed: Error in remote call to 'FishEye 0 (' ( [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1822, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            Guilherme Blanco
            Rafael Dohms
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: