From e36c9895ccd4a4cf8c473f1f3a58a8286d70ed3c Mon Sep 17 00:00:00 2001 From: Nabil Abdel-Hafeez <7283535+987Nabil@users.noreply.github.com> Date: Mon, 10 Jul 2023 03:57:20 +0200 Subject: [PATCH] Add DecoderError for unsupported schemas --- .../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" + } + }