[KAFKA-319] Include the full cause in log message on schema failure Created: 30/Jun/22  Updated: 28/Oct/23  Resolved: 09/Aug/22

Status: Closed
Project: Kafka Connector
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Ross Lawley Assignee: Maxim Katcharov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Extended debugging for Kafka Connector

 Description   

Current code loses the original error message but outputs the stacktrace:

    } catch (Exception e) {
      Supplier<String> errorMessage =
          () ->
              format(
                  "Exception creating Source record for: Key=%s Value=%s",
                  keyDocument.toJson(), valueDocument.toJson());
      if (sourceConfig.logErrors()) {
        LOGGER.error(errorMessage.get(), e);
      }

Update the errorMessage supplier to include the original exception message at the start of the message.


Generated at Thu Feb 08 09:06:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.