KalleOlaviNiemitalo commented on code in PR #2587:
URL: https://github.com/apache/avro/pull/2587#discussion_r1401427611


##########
lang/rust/avro/src/error.rs:
##########
@@ -480,6 +480,39 @@ pub enum Error {
     BadCodecMetadata,
 }
 
+#[derive(thiserror::Error, Debug)]
+pub enum CompatibilityError {
+  #[error("Schemas are not compatible. Writer schema is {writer_schema_type}, 
but reader schema is {reader_schema_type}")]
+  WrongType { writer_schema_type: String, reader_schema_type: String},
+
+  #[error("Schemas are not compatible. The {schema_type} should have been 
{expected_type}")]
+  TypeExpected {schema_type: String, expected_type: String},
+
+  #[error("Schemas are not compatible. Field '{0}' in reader schema does not 
match the type in the writer schema")]
+  FieldTypeMissmatch(String),
+
+  #[error("Schemas are not compatible. Schemas missmatch")]
+  SchemaMissmatch,

Review Comment:
   Should be ["mismatch"](https://en.wiktionary.org/wiki/mismatch) with one "s".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to