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;
    }
}

@@ -215,16 +215,61 @@
 ther %7D;%0A
+    public enum UseMessage %7B Unset, Yes, No%7D%0A
     priv
@@ -314,16 +314,65 @@
 rorKind;
+%0A    private TmdbException.UseMessage useMessage;
 %0A%0A    pr
@@ -848,16 +848,62 @@
 Unset);%0A
+        this.setUseMessage(UseMessage.Unset);%0A
     %7D%0A%0A 
@@ -1674,24 +1674,24 @@
 etryTime) %7B%0A
-
         this
@@ -1719,11 +1719,185 @@
 e;%0A    %7D
+%0A%0A    public UseMessage getUseMessage() %7B%0A        return useMessage;%0A    %7D%0A%0A    public void setUseMessage(UseMessage useMessage) %7B%0A        this.useMessage = useMessage;%0A    %7D
 %0A%7D%0A

add flag in tmdbexception