Kriskras99 commented on PR #666:
URL: https://github.com/apache/avro-rs/pull/666#issuecomment-5575143240

   I still need to do schema, but here is a sample of improved error messages 
(top is new, bottom is old):
   ```
   The value is invalid for the given schema: Unsupported value-schema 
combination! Value: Record.b.Record.z.Null, schema: Int
   The value is invalid for the given schema: Unsupported value-schema 
combination! Value: Null, schema: Int
   ```
   ```
   The value is invalid for the given schema: Unsupported value-schema 
combination! Value: Record.b.String, schema: Record(RecordSchema { name: Name { 
name: "Inner", .. }, fields: [RecordField { name: "z", schema: Int, .. }], .. })
   The value is invalid for the given schema: Unsupported value-schema 
combination! Value: String("testing"), schema: Record(RecordSchema { name: Name 
{ name: "Inner", .. }, fields: [RecordField { name: "z", schema: Int, .. }], .. 
})
   ```
   ```
   The value is invalid for the given schema: Unsupported value-schema 
combination! Value: Record.a.Boolean, schema: Long
   The value is invalid for the given schema: Unsupported value-schema 
combination! Value: Boolean(false), schema: Long
   ```
   ```
   The value is invalid for the given schema: Enum("spades") is not at position 
1 in the schema
   The value is invalid for the given schema: Symbol 'spades' is not at 
position '1'
   ```
   ```
   The value is invalid for the given schema: Size of Fixed (5) is different 
than the schema's size (4)
   The value is invalid for the given schema: The value's size (5) is different 
than the schema's size (4)
   ```
   ```
   Invalid value: Int(42) for schema: Boolean. Reason: Unsupported value-schema 
combination! Value: Int(42), schema: Boolean
   Invalid value: Int(42) for schema: Boolean. Reason: Unsupported value-schema 
combination! Value: Int, schema: Boolean
   ```
   ```
   Value Int(1) does not match schema String: Reason: Unsupported value-schema 
combination! Value: Int, schema: String
   Value Int(1) does not match schema String: Reason: Unsupported value-schema 
combination! Value: Int(1), schema: String
   ```
   You'll notice that when the actual value (`1`, `True`, `"Some string"`) is 
not relevant to the error, it is not in included.


-- 
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