From 7f1926a74082dda8fde5cfbb0c9ba182de046a64 Mon Sep 17 00:00:00 2001 From: Nabil Abdel-Hafeez <7283535+987Nabil@users.noreply.github.com> Date: Tue, 5 Sep 2023 23:33:13 +0200 Subject: [PATCH] Add DecoderError for unsupported schemas (#583) Co-authored-by: Daniel Vigovszky --- .../shared/src/main/scala/zio/schema/codec/DecodeError.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zio-schema/shared/src/main/scala/zio/schema/codec/DecodeError.scala b/zio-schema/shared/src/main/scala/zio/schema/codec/DecodeError.scala index 2189922ef..e16677ac0 100644 --- a/zio-schema/shared/src/main/scala/zio/schema/codec/DecodeError.scala +++ b/zio-schema/shared/src/main/scala/zio/schema/codec/DecodeError.scala @@ -59,4 +59,8 @@ object DecodeError { def message: String = s"Value $values and $structure have incompatible shape" } + final case class UnsupportedSchema(schema: Schema[_], decoderName: String) extends DecodeError { + def message: String = s"Schema $schema is not supported by $decoderName" + } + }