Newer
Older
KeeperJerry_Launcher / Launcher / source-authlib / exceptions / MinecraftClientException.java
@KeeperJerry KeeperJerry on 8 Jan 2022 741 bytes Ну допустим
package com.mojang.authlib.exceptions;

public class MinecraftClientException extends RuntimeException {

    public enum ErrorType {
        SERVICE_UNAVAILABLE,
        HTTP_ERROR,
        JSON_ERROR
    }

    protected final ErrorType type;

    protected MinecraftClientException(final ErrorType type, final String message) {
        super(message);
        this.type = type;
    }

    public MinecraftClientException(final ErrorType type, final String message, final Throwable cause) {
        super(message, cause);
        this.type = type;
    }

    public ErrorType getType() {
        return type;
    }

    public AuthenticationException toAuthenticationException() {
        return new AuthenticationException(this);
    }
}