Create common parent for write concern and write errors

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Blocker - P1
    • 1.0.0-rc0
    • Affects Version/s: 1.0.0-beta1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, WriteConcernException, which is used for "soft" write concern errors, extends WriteException, which is directly used for "hard" write errors. This makes users do something like the following if they with to ignore soft errors:

      try {
          ...
      } catch (WriteConcernException $e) {
          // do nothing
      } catch (WriteException $e) {
          // do something
      }
      

      Instead we should have:

      • class WriteConcernException extends WriteException
      • class WriteErrorException extends WriteException
      • abstract class WriteException extends RuntimeException

      Any place where we currently throw WriteException should be changed to WriteErrorException.

      Any classes that extend WriteException (e.g. DuplicateKeyException) should be changed to extend WriteErrorException.

            Assignee:
            Jeremy Mikola
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: