[ 
https://issues.apache.org/jira/browse/AVRO-4029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Tzvetanov Grigorov updated AVRO-4029:
--------------------------------------------
    Description: 
While working on AVRO-4024 I noticed that the error messages print only the 
value's kind, i.e. type. IMO it would be better to print the value itself, so 
the developer could easily debug the problem.

For example Schema:Double could accept special string values like "NaN" or 
"Inf". Passing a value like Value::String("unknown") would fail with error like 
"double expected, got String".

Now the error is:
{code:java}
 Expected Value::Double, Value::Float, Value::Int, Value::Long or Value::String 
("NaN", "INF", "Infinity", "-INF" or "-Infinity"), got: 
Value::String('unknown')"{code}

  was:
While working on AVRO-4024 I noticed that the error messages print only the 
value's kind, i.e. type. IMO it would be better to print the value itself, so 
the developer could easily debug the problem.

For example Schema:Double could accept special string values like "NaN" or 
"Inf". Passing a value like Value::String("unknown") would fail with error like 
"double expected, got String".

Now the error is: ****

Expected Value::Double, Value::Float, Value::Int, Value::Long or Value::String 
("NaN", "INF", "Infinity", "-INF" or "-Infinity"), got: 
Value::String('unknown')"


> [Rust] Improve the error messages related to value resolving
> ------------------------------------------------------------
>
>                 Key: AVRO-4029
>                 URL: https://issues.apache.org/jira/browse/AVRO-4029
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: rust
>            Reporter: Martin Tzvetanov Grigorov
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Minor
>
> While working on AVRO-4024 I noticed that the error messages print only the 
> value's kind, i.e. type. IMO it would be better to print the value itself, so 
> the developer could easily debug the problem.
> For example Schema:Double could accept special string values like "NaN" or 
> "Inf". Passing a value like Value::String("unknown") would fail with error 
> like "double expected, got String".
> Now the error is:
> {code:java}
>  Expected Value::Double, Value::Float, Value::Int, Value::Long or 
> Value::String ("NaN", "INF", "Infinity", "-INF" or "-Infinity"), got: 
> Value::String('unknown')"{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to