generated from athena-framework/component-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce more specialized exception types (#16)
* Introduce more specialized exception types * Better leverage admonition markdown extension
- Loading branch information
1 parent
5195221
commit 8938ce3
Showing
17 changed files
with
123 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: athena-serializer | ||
|
||
version: 0.2.6 | ||
version: 0.2.7 | ||
|
||
crystal: '>= 0.35.0' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "./serializer_exception" | ||
|
||
# Represents an error that occurred during deserialization. | ||
class Athena::Serializer::Exceptions::DeserializationException < Athena::Serializer::Exceptions::SerializerException | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require "./property_exception" | ||
|
||
# Represents an error due to a missing required property that was not included in the input data. | ||
# | ||
# Exposes the missing property's name and type. | ||
class Athena::Serializer::Exceptions::MissingRequiredProperty < Athena::Serializer::Exceptions::PropertyException | ||
getter property_type : String | ||
|
||
def initialize(property_name : String, @property_type : String) | ||
super "Missing required property: '#{property_name}'.", property_name | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require "./property_exception" | ||
|
||
# Represents an error due to a required property that was `nil`. | ||
# | ||
# Exposes the property's name and type. | ||
class Athena::Serializer::Exceptions::NilRequiredProperty < Athena::Serializer::Exceptions::PropertyException | ||
getter property_type : String | ||
|
||
def initialize(property_name : String, @property_type : String) | ||
super "Required property '#{property_name}' cannot be nil.", property_name | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require "./serializer_exception" | ||
|
||
# Represents an error due to an invalid property. | ||
# | ||
# Exposes the property's name. | ||
class Athena::Serializer::Exceptions::PropertyException < Athena::Serializer::Exceptions::DeserializationException | ||
getter property_name : String | ||
|
||
def initialize(message : String, @property_name : String) | ||
super message | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "./serializer_exception" | ||
|
||
# Represents an error that occurred during serialization. | ||
class Athena::Serializer::Exceptions::SerializationException < Athena::Serializer::Exceptions::SerializerException | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Base Exception of the `Athena::Serializer` component. | ||
# Can be used to rescue _all_ serializer related exceptions. | ||
class Athena::Serializer::Exceptions::SerializerException < ::Exception | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters