Skip to content

Commit 92d1f6d

Browse files
committed
Anthropic should throw AnthropicScalaClientExceptions, upgrade scala mock to 6.0.0 to compile with Scala 3
1 parent 91b9499 commit 92d1f6d

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

anthropic-client/build.sbt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import Dependencies.Versions._
2+
13
name := "openai-scala-anthropic-client"
24

35
description := "Scala client for Anthropic API implemented using Play WS lib."
46

57
libraryDependencies += "org.scalactic" %% "scalactic" % "3.2.18"
68
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.18" % Test
7-
libraryDependencies += "org.scalamock" %% "scalamock" % "5.1.0" % Test
9+
libraryDependencies += "org.scalamock" %% "scalamock" % scakaMock % Test

anthropic-client/src/main/scala/io/cequence/openaiscala/anthropic/service/HandleAnthropicErrorCodes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ trait HandleAnthropicErrorCodes extends WSRequestHelper {
3737
case 529 => throw new AnthropicScalaEngineOverloadedException(errorMessage)
3838

3939
// 400 - invalid_request_error: There was an issue with the format or content of your request. We may also use this error type for other 4XX status codes not listed below.
40-
case 400 => throw new OpenAIScalaClientException(errorMessage)
40+
case 400 => throw new AnthropicScalaClientException(errorMessage)
4141

42-
case _ => throw new OpenAIScalaClientException(errorMessage)
42+
case _ => throw new AnthropicScalaClientException(errorMessage)
4343
}
4444
}
4545
}

openai-client/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ libraryDependencies ++= Seq(
2626

2727
libraryDependencies += "org.scalactic" %% "scalactic" % "3.2.18"
2828
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.18" % Test
29-
libraryDependencies += "org.scalamock" %% "scalamock" % "5.1.0" % Test
29+
libraryDependencies += "org.scalamock" %% "scalamock" % scakaMock % Test
3030

3131
//libraryDependencies ++= Seq(
3232
// "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",

project/Dependencies.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ object Dependencies {
22

33
object Versions {
44
val wsClient = "0.3.0"
5+
val scakaMock = "6.0.0"
56
}
67

78
}

0 commit comments

Comments
 (0)