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

org.davidmoten.oa3.codegen.spring.runtime.internal.Util Maven / Gradle / Ivy

The newest version!
package org.davidmoten.oa3.codegen.spring.runtime.internal;

import org.davidmoten.oa3.codegen.spring.runtime.ServiceException;

public final class Util {

    public static int statusCode(Throwable e) {
        final int statusCode;
        if (e instanceof ServiceException) {
            statusCode = ((ServiceException) e).statusCode();
        } else if (e instanceof IllegalArgumentException) {
            statusCode = 400;
        } else {
            statusCode = 500;
        }
        return statusCode;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy