Skip to content

Commit

Permalink
Show "Received malformed sequence exception" warning stacktrace only …
Browse files Browse the repository at this point in the history
…when verbose is enabled. Close #36 (#37)
  • Loading branch information
maxirosson authored May 24, 2021
1 parent 7b65c14 commit 4dda8cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = '1.1.2'
version = '1.1.3'

ext.GITHUB_REPOSITORY_NAME = "bye-bye-jetifier"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ class XmlResourceScanner(
// files so we at least try to recover by defaulting to UTF-8.
LoggerHelper.warn("Received malformed sequence exception when trying to detect the encoding " +
"for ${file.fileName}. Defaulting to UTF-8.")
val tracePrinter = StringWriter()
e.printStackTrace(PrintWriter(tracePrinter))
LoggerHelper.warn(tracePrinter.toString())
if (LoggerHelper.verbose) {
val tracePrinter = StringWriter()
e.printStackTrace(PrintWriter(tracePrinter))
LoggerHelper.warn(tracePrinter.toString())
}
return StandardCharsets.UTF_8
}
}
Expand Down

0 comments on commit 4dda8cb

Please sign in to comment.