com.eg.agent.android.util.Error Maven / Gradle / Ivy
The newest version!
package com.eg.agent.android.util;
import com.eg.agent.android.logging.EGAgentLog;
import com.eg.agent.android.logging.EGAgentLogManager;
import com.eg.agent.android.networkinformation.ExceptionUtils;
import com.eg.agent.android.EGAgent;
import org.json.JSONObject;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* Created by Venkateswari.J on 4/25/2017.
*/
public class Error {
private final String url;
private final int httpStatusCode;
private int count;
private int errorCode;
private final String responseBody;
private final String stackTrace;
private final Map params;
private final String digest;
private static final EGAgentLog log = EGAgentLogManager.getAgentLog();
public Error(int errorCode) {
this(null, 0, null, null);
this.errorCode = errorCode;
}
public Error(String url, int httpStatusCode, String responseBody, Map params) {
this.url = url;
this.httpStatusCode = httpStatusCode;
this.count = 1;
this.responseBody = responseBody;
this.stackTrace = this.getSanitizedStackTrace();
this.params = params;
this.digest = this.computeHash();
}
public String getUrl() {
return this.url;
}
public int getHttpStatusCode() {
return this.httpStatusCode;
}
public int getCount() {
return this.count;
}
public String getResponseBody() {
return this.responseBody;
}
public String getStackTrace() {
return this.stackTrace;
}
public Map getParams() {
return this.params;
}
public String getHash() {
return this.digest;
}
public List