Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1165

Stop unwinding runtime exceptions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0M5
    • Undefined future
    • Core Library
    • None

    Description

      The practice of unwinding Cayenne exceptions seemed like a good idea at the time. This would look like:

      try

      { .... }

      catch (Exception ex)

      { throw new CayenneException("Exception", Util.unwindException(ex)); }

      And was supposed to trim Exception chain to just the underlying cause plus a Cayenne[Runtime]Exception wrapper. However in many cases intermediate places where Cayenne catches exception, wraps it and rethrows, provide additional forensics info helping to identify the cause. For instance FieldAccessor shows which field has failed:

      try

      { field.set(object, newValue); }

      catch (Throwable th)

      { throw new PropertyException( "Error writing field: " + field.getName(), this, object, th); }

      So I think we should get rid of all calls to Util.unwindException(..) and rethrow it unchanged.

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: