Uploaded image for project: 'Solder'
  1. Solder
  2. SOLDER-151

Provide exception type mapping (to deal with vendor-specific exception types)

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.1.0.Beta1
    • Component/s: Core
    • Labels:
      None
    • Affects:
      Documentation (Ref Guide, User Guide, etc.)
    • Estimated Difficulty:
      Medium

      Description

      There are cases when the useful information about an exception is only available in an implementation-specific exception. It would be useful to provide an exception type mapping infrastructure so that implementation-specific exceptions can be mapped to portable exception types.

      A classic example is JPA provider exceptions. Hibernate throws a SQLGrammarException in cases where the SQL statement is invalid (has a syntax error or refers to an invalid table/column). However, if you are writing portable JPA code, you cannot catch this exception. Thus, it would be useful to be able to catch an portable exception that represents this vendor-specific exception.

      Obviously, the actual mapping in this example would be done in the persistence module. Catch needs to provide some mechanism for an integration to register the mappings, which it will honor when notifying handlers.

      It should be noted that this is a very popular feature from Spring. Refer to SessionFactoryUtils for an example of the exception type mapping.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  lightguard Jason Porter
                  Reporter:
                  dan.j.allen Dan Allen
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: