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

com.github.longhaoteng.core.exception.ApiException Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package com.github.longhaoteng.core.exception;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.http.HttpStatus;

/**
 * ApiException
 *
 * @author mr.long
 */
@Getter
@Setter
@NoArgsConstructor
public class ApiException extends Exception {

    // error code
    private int code;

    // error message
    private String message;

    public ApiException(int code, String message) {
        super(message);
        this.message = message;
        this.code = code;
    }

    public ApiException(HttpStatus status, String message) {
        super(message);
        this.code = status.value();
        this.message = message;
    }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy