diff --git a/zio-http/src/main/scala/zhttp/http/HttpError.scala b/zio-http/src/main/scala/zhttp/http/HttpError.scala index 71944eb55e..d8bf6859d9 100644 --- a/zio-http/src/main/scala/zhttp/http/HttpError.scala +++ b/zio-http/src/main/scala/zhttp/http/HttpError.scala @@ -120,6 +120,6 @@ object HttpError { final case class BadGateway(msg: String = "Bad Gateway") extends HttpError(Status.BadGateway, msg) - final case class CustomResponseStatus(code: Int, reason: String) extends HttpError(Status.Custom(code), reason) + final case class Custom(code: Int, reason: String) extends HttpError(Status.Custom(code), reason) } diff --git a/zio-http/src/test/scala/zhttp/http/HttpErrorSpec.scala b/zio-http/src/test/scala/zhttp/http/HttpErrorSpec.scala index f4e910e030..d93766d5a0 100644 --- a/zio-http/src/test/scala/zhttp/http/HttpErrorSpec.scala +++ b/zio-http/src/test/scala/zhttp/http/HttpErrorSpec.scala @@ -17,7 +17,7 @@ object HttpErrorSpec extends DefaultRunnableSpec { assert(result)(equalTo("Page not found")) } + test("should create custom error") { - val error = HttpError.CustomResponseStatus(451, "Unavailable for legal reasons.") + val error = HttpError.Custom(451, "Unavailable for legal reasons.") assert(error.status)(equalTo(Status.Custom(451))) } }