Skip to content

Commit

Permalink
fix: emit errors even when not in verbose mode.
Browse files Browse the repository at this point in the history
It was supposed to do this, but we stopped calling logger.error(), which is
what would trigger that behavior.
  • Loading branch information
autonomousapps committed Nov 1, 2024
1 parent 49a9e82 commit 9c6dc88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/kotlin/com/squareup/sort/SortCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ class SortCommand(
logger.trace("Successfully sorted: ${file.pathString} ")
successCount++
} catch (e: BuildScriptParseException) {
logger.warn("Parsing error: ${file.pathString} \n${e.localizedMessage}")
logger.error("Parsing error: ${file.pathString} \n${e.localizedMessage}")
parseErrorCount++
} catch (e: IllegalStateException) {
logger.warn("Parsing error: ${file.pathString} \n${e.localizedMessage}")
logger.error("Parsing error: ${file.pathString} \n${e.localizedMessage}")
parseErrorCount++
} catch (_: AlreadyOrderedException) {
logger.trace("Already ordered: ${file.pathString} ")
Expand Down Expand Up @@ -170,11 +170,11 @@ class SortCommand(
}
if (sorter.hasParseErrors()) {
val error = checkNotNull(sorter.getParseError()) { "There must be a parse error." }
logger.trace("Parsing error: ${file.pathString} \n${error.localizedMessage}")
logger.error("Parsing error: ${file.pathString} \n${error.localizedMessage}")
parseErrorCount++
}
} catch (t: Throwable) {
logger.trace("Parsing error: ${file.pathString}")
logger.error("Parsing error: ${file.pathString}")
parseErrorCount++
}
}
Expand Down

0 comments on commit 9c6dc88

Please sign in to comment.