io.github.stewseo.client.json.jackson.JacksonUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yelp-fusion-client Show documentation
Show all versions of yelp-fusion-client Show documentation
java client to build api objects, handle http transport, and parse/deserialize/serialize json to/from json
package io.github.stewseo.client.json.jackson;
import com.fasterxml.jackson.core.JsonParseException;
import jakarta.json.JsonException;
import jakarta.json.stream.JsonGenerationException;
import jakarta.json.stream.JsonParsingException;
import java.io.IOException;
public class JacksonUtils {
public static JsonException convertException(IOException ioe) {
if (ioe instanceof com.fasterxml.jackson.core.JsonGenerationException) {
return new JsonGenerationException(ioe.getMessage(), ioe);
} else if (ioe instanceof JsonParseException) {
JsonParseException jpe = (JsonParseException) ioe;
return new JsonParsingException(ioe.getMessage(), jpe, new JacksonJsonpLocation(jpe.getLocation()));
} else {
return new JsonException("Jackson exception", ioe);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy