Uploaded image for project: 'Perl Driver'
  1. Perl Driver
  2. PERL-164

Driver should optionally allow non-croaking

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Won't Fix
    • Affects Version/s: 0.45
    • Fix Version/s: 1.0.0
    • Component/s: Perl driver
    • Labels:
      None
    • Environment:
      Any
    • Story Points:
      0
    • Sprint:
      Perl Sprint 17

      Description

      At the moment, the safest way to call various routines in the driver API is with an eval {} block, This is because you cannot avoid the driver calling "croak". For example:

      If the safe option is not set, ensure_index will not return anything unless there is a socket error (in which case it will croak). If the safe option is set and the index creation fails, it will also croak.

      So this is an enhancement request to provide optional error handling which does not croak. My recommendation would be to allow driver routines to return an "undef" if something went bad; perhaps allow a fast way to check the last_error on the connection and/or ensure us documentation readers that trying to see what failed does not require another round on the wire with the database.

      See the following discussion.

      https://groups.google.com/forum/?fromgroups#!topic/mongodb-user/5VNdnqxdX2o

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              david.golden David Golden
              Reporter:
              mightyd Dave Hayes
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: