
com.zandero.rest.exception.GenericExceptionHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest.vertx Show documentation
Show all versions of rest.vertx Show documentation
JAX-RS REST annotation processor for vert.x verticals
The newest version!
package com.zandero.rest.exception;
import com.zandero.utils.StringUtils;
import io.vertx.core.http.*;
/**
*
*/
public class GenericExceptionHandler implements ExceptionHandler {
@Override
public void write(Throwable exception, HttpServerRequest request, HttpServerResponse response) {
String message = exception.getMessage();
if (StringUtils.isNullOrEmptyTrimmed(message)) {
response.end(exception.toString());
} else {
response.end(message);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy