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

org.cinchapi.quest.util.Exceptions Maven / Gradle / Ivy

Go to download

Quest is a JVM framework for quickly defining both api endpoints and view controllers in a web application

The newest version!
package org.cinchapi.quest.util;

import com.google.common.base.Strings;

/**
 * Utility class for handling Exceptions.
 * 
 * @author jnelson
 */
public class Exceptions {

    /**
     * Reliably get a message that describes the {@code exception}.
     * 
     * @param e
     * @return the Exception message
     */
    public static String getMessage(Exception exception) {
        String message = exception.getMessage();
        if(Strings.isNullOrEmpty(message)) {
            message = exception.getClass().getSimpleName();
        }
        return message;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy