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

com.volcengine.error.SdkError Maven / Gradle / Ivy

There is a newer version: 1.0.184
Show newest version
package com.volcengine.error;

public enum SdkError {
    UNKNOWN(-1),
    SUCCESS(0),
    ENOAPI(10001),
    ENOFILE(10002),
    ERESP(10003),
    ESIGN(10004),
    EHTTP(10005),
    EINTERNAL(10006),
    EENCODING(10007),
    EUPLOAD(10008);


    private final int value;

    SdkError(final int value) {
        this.value = value;
    }

    public static final String getErrorDesc(SdkError errorType) {
        switch (errorType) {
            case UNKNOWN:
                return "unkown error";
            case SUCCESS:
                return "success";
            case ENOAPI:
                return "no this api";
            case ENOFILE:
                return "cant find file";
            case ERESP:
                return "response error";
            case ESIGN:
                return "sign error";
            case EHTTP:
                return "http request error";
            case EENCODING:
                return "encoding error";
            case EINTERNAL:
                return "internal error";
            case EUPLOAD:
                return "upload error";
            default:
                return "unknown error";
        }
    }

    public final int getNumber() {
        return this.value;
    }

    public static final SdkError getError(int value) {
        for (SdkError error : SdkError.values()) {
            if (value == error.value) {
                return error;
            }
        }
        return UNKNOWN;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy