Skip to content

Commit

Permalink
http-codegen (fix): Improve the error messages for unknown client typ…
Browse files Browse the repository at this point in the history
…es (#3198)
  • Loading branch information
yuokada authored Sep 7, 2023
1 parent 659d15a commit 3158b64
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,18 @@ object HttpClientGeneratorConfig {
HttpClientGeneratorConfig(
apiPackageName = packageName,
clientType = HttpClientGenerator.findClient(tpe).getOrElse {
throw new IllegalArgumentException(s"Unknown client type: ${tpe}")
tpe match {
case "scalajs" =>
throw new IllegalArgumentException(
s"Unknown client type: ${tpe}. scalajs is obsoleted. Use rpc instead}"
)
case _ =>
throw new IllegalArgumentException(
s"Unknown client type: ${tpe}. Supported client types: ${HttpClientGenerator.predefinedClients
.map(_.name).mkString(", ")}"
)
}

},
targetPackageName = targetPackage,
targetClassName = targetCls
Expand Down

0 comments on commit 3158b64

Please sign in to comment.