Skip to content

Commit

Permalink
make HttpError and DeserializationException covariant to follow varia…
Browse files Browse the repository at this point in the history
…nce of ResponseException (#2357)
  • Loading branch information
NPCRUS authored Dec 2, 2024
1 parent f8c64a7 commit fcbbab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/sttp/client4/ResponseException.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import sttp.model.StatusCode
import scala.annotation.tailrec

sealed abstract class ResponseException[+HE, +DE](error: String) extends Exception(error)
case class HttpError[HE](body: HE, statusCode: StatusCode)
case class HttpError[+HE](body: HE, statusCode: StatusCode)
extends ResponseException[HE, Nothing](s"statusCode: $statusCode, response: $body")
case class DeserializationException[DE: ShowError](body: String, error: DE)
case class DeserializationException[+DE: ShowError](body: String, error: DE)
extends ResponseException[Nothing, DE](implicitly[ShowError[DE]].show(error))

object HttpError {
Expand Down

0 comments on commit fcbbab5

Please sign in to comment.