Uploaded image for project: 'mod-oai-pmh'
  1. mod-oai-pmh
  2. MODOAIPMH-241

Improved error handling & reporting of mapping failures

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Duplicate
    • None
    • None
    • None
    • Concorde

    Description

      Overview

      Mapping failures due to "dirty"/"bad" data in the source record aren't handled very gracefully. The exception is AFACT uncaught, resulting in the client to wait indefinitely, or until the request times out.

      It would be helpful if an error response was returned to the client, and to log an error message indicating which record was problematic.

      Currently this what we get in the log when this happens:

      2020-10-06T14:35:49,703 DEBUG [vert.x-eventloop-thread-0] MarcXmlMapper Marc-json converted to MarcXml after 0 ms
      2020-10-06T14:35:49,703 DEBUG [vert.x-eventloop-thread-0] ResponseConverter Array of bytes converted to Object after 0 ms
      2020-10-06T14:35:49,703 DEBUG [vert.x-eventloop-thread-0] MarcXmlMapper Marc-json converted to MarcXml after 0 ms
      2020-10-06T14:35:49,704 DEBUG [vert.x-eventloop-thread-0] ResponseConverter Array of bytes converted to Object after 0 ms
      2020-10-06T14:35:49,704 DEBUG [vert.x-eventloop-thread-0] MarcXmlMapper Marc-json converted to MarcXml after 0 ms
      2020-10-06T14:35:49,708 DEBUG [vert.x-eventloop-thread-0] ResponseConverter Array of bytes converted to Object after 3 ms
      2020-10-06T14:35:49,708 ERROR [vert.x-eventloop-thread-0] HttpClientResponseImpl java.lang.IllegalStateException: The byte array cannot be converted to JAXB object response.
      

      Reproducer

      I've seen this caused by non-utf-8 characters in the source record. For example:
      "Orcadvm et Schetlandiæ Insularvm accuratissima descriptio"

      Acceptance Criteria

      • An error message is logged indicating that there was a problem mapping the source record to the desired format, including the id of the problematic record.
      • Mapping exceptions are caught and handled.
      • An error response is returned to the client

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                cmcnally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases