/*
 * Copyright (c) 2017 pCloud AG
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.pcloud.sdk.api;

import java.util.Locale;

public class ApiError extends Exception {

    private int errorCode;
    private String errorMessage;

    public ApiError(int errorCode, String errorMessage) {
        super(String.format(Locale.US, "%d - %s", errorCode, errorMessage));
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}

@@ -646,16 +646,346 @@
 ocale;%0A%0A
+/**%0A * An exception class resembling pCloud API errors.%0A * %3Cp%3E%0A * %3Cp%3E%0A * For more information on errors and their meaning, see %3Ca href=%22https://docs.pcloud.com/errors/index.html%22%3E the errors section%3C/a%3E%0A * or browse through method-specific pages at the %3Ca href=%22https://docs.pcloud.com/%22%3EAPI documentation%3C/a%3E.%0A * %3Cp%3E%0A * %3C/p%3E%0A */%0A
 public c
@@ -1308,68 +1308,277 @@
     
-public int getErrorCode() %7B%0A        return errorCode;%0A    %7D%0A
+/**%0A     * Returns an error code for the API error.%0A     *%0A     * @return the error code%0A     */%0A    public int getErrorCode() %7B%0A        return errorCode;%0A    %7D%0A%0A    /**%0A     * Returns a brief message describing the error.%0A     *%0A     * @return non-null message%0A     */
 %0A   

Add documentation for the ApiError class