Skip to content

Commit

Permalink
Merge pull request #10150 from fusuiyi123/ISSUE-8474
Browse files Browse the repository at this point in the history
Improve No valid constructors error message to suggest a list of valid constructors
  • Loading branch information
mergify[bot] committed Mar 30, 2020
2 parents ffc8ac6 + 169b73e commit 76ad96d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/play/src/main/scala/play/api/inject/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,14 @@ object Modules {
tryConstruct()
}
.getOrElse {
throw new PlayException("No valid constructors", "Module [" + className + "] cannot be instantiated.")
throw new PlayException(
"No valid constructors",
"Module [" + className + "] cannot be instantiated. " +
"Expected one of:\n" +
"()\n" +
"(play.api.Environment, play.api.Configuration)\n" +
"(play.Environment, com.typesafe.config.Config)"
)
}
} catch {
case e: PlayException => throw e
Expand Down

0 comments on commit 76ad96d

Please sign in to comment.