diff --git a/shard.yml b/shard.yml index 2da3b25..7ca243d 100644 --- a/shard.yml +++ b/shard.yml @@ -1,10 +1,10 @@ name: caridina -version: 0.8.0 +version: 0.9.0 authors: - Alexandre Morignot -crystal: 0.35.0 +crystal: 0.36.1 description: | A Matrix client library diff --git a/spec/caridina/events/macros_spec.cr b/spec/caridina/events/macros_spec.cr index 47e9860..ba476c3 100644 --- a/spec/caridina/events/macros_spec.cr +++ b/spec/caridina/events/macros_spec.cr @@ -222,7 +222,7 @@ describe "caridina_use_json_discriminator" do end it "raises with incomplet indirect discriminator" do - expect_raises(JSON::MappingError) do + expect_raises(JSON::SerializableError) do ManyIndirectDiscriminator.from_json(%( { "othertype": { @@ -400,7 +400,7 @@ describe "caridina_use_json_discriminator" do end it "raises if the discriminator value is unknown and not fallback is provided" do - expect_raises(JSON::MappingError) do + expect_raises(JSON::SerializableError) do UniqueSimpleDiscriminator.from_json(%( { "type": "unknown" diff --git a/spec/caridina/spec_helper.cr b/spec/caridina/spec_helper.cr index 5199d62..cba784c 100644 --- a/spec/caridina/spec_helper.cr +++ b/spec/caridina/spec_helper.cr @@ -1 +1 @@ -require "../spec_helper" \ No newline at end of file +require "../spec_helper" diff --git a/src/caridina.cr b/src/caridina.cr index 228d213..ac7c85e 100644 --- a/src/caridina.cr +++ b/src/caridina.cr @@ -3,7 +3,7 @@ require "./caridina/connection" module Caridina - VERSION = "0.8.0" + VERSION = "0.9.0" Log = ::Log.for(self) end diff --git a/src/caridina/events/macros.cr b/src/caridina/events/macros.cr index f9c7c65..33a5641 100644 --- a/src/caridina/events/macros.cr +++ b/src/caridina/events/macros.cr @@ -149,7 +149,7 @@ macro caridina_use_json_discriminator(mapping, fallback = nil) fields = {{mapping.keys.id}} unless discriminators.size - raise ::JSON::MappingError.new("JSON is missing one of discriminator fields: #{fields}", to_s, nil, *location, nil) + raise ::JSON::SerializableError.new("JSON is missing one of discriminator fields: #{fields}", to_s, nil, *location, nil) end # Order the discriminators found by priority, higher priority first. @@ -177,7 +177,7 @@ macro caridina_use_json_discriminator(mapping, fallback = nil) {% if fallback %} {{fallback.id}}.from_json(json) {% else %} - raise ::JSON::MappingError.new("Unknown discriminators #{discriminators.inspect}", to_s, nil, *location, nil) + raise ::JSON::SerializableError.new("Unknown discriminators #{discriminators.inspect}", to_s, nil, *location, nil) {% end %} end end