Skip to content

Commit

Permalink
Improve the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Sep 8, 2024
1 parent bf00d0d commit b24dae2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class ErrorClassesJsonReader(jsonFileURLs: Seq[URL]) {
val placeHoldersNum = ErrorClassesJsonReader.TEMPLATE_REGEX.findAllIn(messageTemplate).length
if (placeHoldersNum < sanitizedParameters.size) {
throw SparkException.internalError(
s"Found unused message parameters for the error class $errorClass. " +
s"Its error message format has $placeHoldersNum place holders, " +
s"Found unused message parameters of the error class '$errorClass'. " +
s"Its error message format has $placeHoldersNum placeholders, " +
s"but the passed message parameters map has ${sanitizedParameters.size} items. " +
"Consider to add place holders to the error format or remove unused message parameters.")
"Consider to add placeholders to the error format or remove unused message parameters.")
}
}
errorMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ class SparkThrowableSuite extends SparkFunSuite {
errorClass = "INTERNAL_ERROR",
parameters = Map(
"message" ->
("Found unused message parameters for the error class CANNOT_UP_CAST_DATATYPE. " +
"Its error message format has 4 place holders, but the passed message parameters map " +
"has 5 items. Consider to add place holders to the error format or " +
("Found unused message parameters of the error class 'CANNOT_UP_CAST_DATATYPE'. " +
"Its error message format has 4 placeholders, but the passed message parameters map " +
"has 5 items. Consider to add placeholders to the error format or " +
"remove unused message parameters.")
)
)
Expand Down

0 comments on commit b24dae2

Please sign in to comment.