Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.robrua.orianna.type.exception;
 import java.util.Map;

Thrown when the Riot API gives an error

Rob Rua (FatalElement - NA) (
public class APIException extends OriannaException {
    public static enum Status {
        private static final Map<IntegerStatuscodes = new HashMap<>();
        static {
            for(final Status m : Status.values()) {
        public static Status forCode(final int code) {
            final Status t = .get(code);
            if(t == null) {
                return ;
            return t;
        private final int code;
        private Status(final int code) {
            this. = code;
    private static final long serialVersionUID = 9149283735403841289L;
    private final Status status;


URI the URI that was being accessed when this error occured
statusCode the HTTP status code returned by the Riot API
    public APIException(final String URIfinal int statusCode) {
        super("A " + Status.forCode(statusCode) + " (" + statusCode + ") error was received from the server for URI " + URI);
         = Status.forCode(statusCode);


the HTTP status returned by the Riot API
    public Status getStatus() {
        return ;
New to GrepCode? Check out our FAQ X