package com.b12kab.tmdblibrary.exceptions;

import java.io.IOException;

public class TmdbException extends IOException {
    public enum RetrofitErrorKind { Unset, NetworkOnMain, Retry, Timeout, ConversionError, Other };
    private TmdbException.RetrofitErrorKind errorKind;

    private int code;
    private String message;
    private Integer httpResponseCode;
    private Integer retryTime;

    public TmdbException() {
        super();
        this.initialize();
    }

    public TmdbException(int code, String message) {
        super(message);
        this.initialize();
        this.setMessage(message);
        this.setCode(code);
    }

    private void initialize() {
        this.setCode(-1);
        this.setErrorKind(RetrofitErrorKind.Unset);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public RetrofitErrorKind getErrorKind() {
        return errorKind;
    }

    public void setErrorKind(RetrofitErrorKind errorKind) {
        this.errorKind = errorKind;
    }

    public Integer getHttpResponseCode() {
        return httpResponseCode;
    }

    public void setHttpResponseCode(Integer httpResponseCode) {
        this.httpResponseCode = httpResponseCode;
    }

    public Integer getRetryTime() {
        return retryTime;
    }

    public void setRetryTime(Integer retryTime) {
        this.retryTime = retryTime;
    }
}

package com.b12kab.tmdblibrary.exceptions;

import java.io.IOException;

public class TmdbException extends IOException {
    public enum RetrofitErrorKind { Unset, NetworkOnMain, Retry, Timeout, ConversionError, Other };
    public enum UseMessage { Unset, Yes, No}
    private TmdbException.RetrofitErrorKind errorKind;
    private TmdbException.UseMessage useMessage;

    private int code;
    private String message;
    private Integer httpResponseCode;
    private Integer retryTime;

    public TmdbException() {
        super();
        this.initialize();
    }

    public TmdbException(int code, String message) {
        super(message);
        this.initialize();
        this.setMessage(message);
        this.setCode(code);
    }

    private void initialize() {
        this.setCode(-1);
        this.setErrorKind(RetrofitErrorKind.Unset);
        this.setUseMessage(UseMessage.Unset);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public RetrofitErrorKind getErrorKind() {
        return errorKind;
    }

    public void setErrorKind(RetrofitErrorKind errorKind) {
        this.errorKind = errorKind;
    }

    public Integer getHttpResponseCode() {
        return httpResponseCode;
    }

    public void setHttpResponseCode(Integer httpResponseCode) {
        this.httpResponseCode = httpResponseCode;
    }

    public Integer getRetryTime() {
        return retryTime;
    }

    public void setRetryTime(Integer retryTime) {
        this.retryTime = retryTime;
    }

    public UseMessage getUseMessage() {
        return useMessage;
    }

    public void setUseMessage(UseMessage useMessage) {
        this.useMessage = useMessage;
    }
}

add flag in tmdbexception