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

org.smartboot.http.common.exception.HttpException Maven / Gradle / Ivy

There is a newer version: 2.0
Show newest version
/*******************************************************************************
 * Copyright (c) 2017-2020, org.smartboot. All rights reserved.
 * project name: smart-http
 * file name: HttpException.java
 * Date: 2020-01-01
 * Author: sandao ([email protected])
 ******************************************************************************/

package org.smartboot.http.common.exception;

import org.smartboot.http.common.enums.HttpStatus;

/**
 * HTTP异常
 *
 * @author 三刀
 * @version V1.0 , 2018/6/3
 */
public class HttpException extends RuntimeException {
    private final HttpStatus httpStatus;

    public HttpException(HttpStatus httpStatus) {
        super(httpStatus.getReasonPhrase());
        this.httpStatus = httpStatus;
    }

    public HttpException(int httpStatusCode, String desc) {
        this(new HttpStatus(httpStatusCode, desc));
    }

    public HttpStatus getHttpStatus() {
        return httpStatus;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy