Skip to content

Commit 91e9428

Browse files
stheppistheppiandrewstevenson
authored
NullPointerException information lost (#174)
The change brings extra logging to identify where the exception occurs. It changes the error log information. Co-authored-by: stheppi <[email protected]> Co-authored-by: Andrew Stevenson <[email protected]>
1 parent 516928d commit 91e9428

File tree

1 file changed

+9
-1
lines changed
  • kafka-connect-cloud-common/src/main/scala/io/lenses/streamreactor/connect/cloud/common/sink/writer

1 file changed

+9
-1
lines changed

kafka-connect-cloud-common/src/main/scala/io/lenses/streamreactor/connect/cloud/common/sink/writer/Writer.scala

+9-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ class Writer[SM <: FileMetadata](
5959
def innerMessageWrite(writingState: Writing): Either[NonFatalCloudSinkError, Unit] =
6060
writingState.formatWriter.write(messageDetail) match {
6161
case Left(err: Throwable) =>
62-
logger.error(err.getMessage)
62+
logger.error(
63+
s"An error occurred while writing using ${writingState.formatWriter.getClass.getSimpleName}. " +
64+
s"Details: Topic-Partition: ${messageDetail.topic.value}-${messageDetail.partition}, " +
65+
s"Offset: ${messageDetail.offset.value}, " +
66+
s"Key: ${messageDetail.key}, " +
67+
s"Value: ${messageDetail.value}, " +
68+
s"Headers: ${messageDetail.headers}.",
69+
err,
70+
)
6371
NonFatalCloudSinkError(err.getMessage, err.some).asLeft
6472
case Right(_) =>
6573
writeState =

0 commit comments

Comments
 (0)