All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zandero.rest.exception.GenericExceptionHandler Maven / Gradle / Ivy

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