tech.ydb.shaded.io.jsonwebtoken.io.ExceptionPropagatingDecoder Maven / Gradle / Ivy
package io.jsonwebtoken.io;
import io.jsonwebtoken.lang.Assert;
/**
* @since 0.10.0
*/
class ExceptionPropagatingDecoder implements Decoder {
private final Decoder decoder;
ExceptionPropagatingDecoder(Decoder decoder) {
Assert.notNull(decoder, "Decoder cannot be null.");
this.decoder = decoder;
}
@Override
public R decode(T t) throws DecodingException {
Assert.notNull(t, "Decode argument cannot be null.");
try {
return decoder.decode(t);
} catch (DecodingException e) {
throw e; //propagate
} catch (Exception e) {
String msg = "Unable to decode input: " + e.getMessage();
throw new DecodingException(msg, e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy