package com.backendsys.SDK.Meitu;

import lombok.Getter;

public class AIException  extends RuntimeException {
    private static final long serialVersionUID = 1L;
    
    public static final int code_cloud_process_err = 20001001;// ai 云处理异常
    public static final int code_cloud_process_net_err = 20001002;// ai 网络异常
    public static final int code_cloud_process_unauthorized = 20001003;// ai 未授权异常
    public static final int code_cloud_process_timeout = 20001003;// ai 处理超时异常
    public static final int code_cloud_get_status_err = 20001003;// ai 获取状态异常

    

    public static final int code_upload_err = 30001001; // 上传错误
    public static final int code_obs_close_err = 30001002; // obs关闭异常
    public static final int code_strategy_err = 30002001;// 策略获取异常
    public static final int code_strategy_net_error = 30002002;// 策略获取异常

    public static final int code_params_err = 40001000;// 参数错误
    public static final int code_params_sig_err = 40001002;// 签名错误
    public static final int code_params_resource = 40002001; // 资源访问异常
    public static final int code_params_resource_notfound= 40002002; // 资源不存在


    public static final int code_serialization_err = 50001001;//序列化错误
    public static final int code_deserialization_err = 50001002;// 反序列化错误
    public static final int code_sig_err = 50001003;// 签名异常


    public static final int code_cloud_biz_config_err = 60001001;// ai 云处理异常
    public static final int code_cloud_biz_config_net_err = 60001002;// ai 网络异常
    


    @Getter
    private int errorCode;

    public AIException(int errorCode,String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public AIException(int errorCode,String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
    }   
    
    public String getMessage() {
        return String.format("%d: %s",this.errorCode,super.getMessage());
    }
    
}
