Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Empty stack trace since it does not help users.
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Jun 19, 2019
1 parent f780fed commit ad49449
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ object Cli {
} match {
case Success(v) => v
case Failure(e: NoSuchFileException) =>
throw new IllegalArgumentException(
val exception = new IllegalArgumentException(
s"""Configuration file ${e.getFile} not found.
|Provide the file in reference to https://github.com/tanishiking/scalaunfmt#configuration""".stripMargin
Provide the file in reference to https://github.com/tanishiking/scalaunfmt#configuration""".stripMargin
)
exception.setStackTrace(Array.empty)
throw exception
case Failure(e) => throw e // unknown
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CliSpec extends FunSpec with Matchers {
Cli.run(opt, System.out, System.err)
}
assert(ex.getMessage.contains("Configuration file NO.SUCH.FILE.conf not found."))
assert(ex.getStackTrace.isEmpty)
}

it("should throw exception for unparsable config") {
Expand Down

0 comments on commit ad49449

Please sign in to comment.