Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Should indicate type that was requested when complaining about Any not being supported #26

Closed
osi opened this issue Nov 20, 2015 · 2 comments
Milestone

Comments

@osi
Copy link

osi commented Nov 20, 2015

in https://github.com/FasterXML/jackson-dataformat-avro/blob/master/src/main/java/com/fasterxml/jackson/dataformat/avro/schema/VisitorFormatWrapperImpl.java#L151

the exception being thrown for expectAnyFormat should include the passed in convertedType in the error message

@cowtowncoder
Copy link
Member

@osi Do you have bit more info to share wrt error message here and what could be more useful version (just an idea of how to add, can be improved). I'll dig into code when I get a chance, but it's easier to glance through issues when prioritizing, help decide which are easy to fix/improve.

@osi
Copy link
Author

osi commented Nov 20, 2015

Just have it be something like:

    @Override
    public JsonAnyFormatVisitor expectAnyFormat(JavaType convertedType) {
        // could theoretically create union of all possible types but...
        return _throwUnsupported("'Any' type not supported when trying to expect " + convertedType);
    }

(I discovered this when convertedType was an OptionalDouble)

@cowtowncoder cowtowncoder modified the milestones: 2.4.0, 2.6.4 Nov 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants