use of io.sentry.core.SentryEvent in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method captureError.
@NonNull
protected String captureError(String errorMessage, long errorCode, String uniqueId, Throwable throwable) {
ErrorOutPut error = new ErrorOutPut(true, errorMessage, errorCode, uniqueId);
String jsonError = gson.toJson(error);
listenerManager.callOnError(jsonError, error);
showErrorLog(jsonError);
if (sentryLog) {
SentryEvent event = new SentryEvent(throwable);
event.setEnvironment("PODCHAT");
event.setLevel(SentryLevel.ERROR);
event.setTag("FROM_SDK", "PODCHAT");
event.setExtra("CACHE ENABLED", " >>> " + cache);
Sentry.captureEvent(event, new PodChatException(errorMessage, uniqueId, getToken()));
}
if (log) {
Log.e(TAG, "ErrorMessage: " + errorMessage + " *Code* " + errorCode + " *uniqueId* " + uniqueId);
}
return jsonError;
}
use of io.sentry.core.SentryEvent in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method captureError.
@NonNull
private String captureError(String errorMessage, long errorCode, String uniqueId) {
ErrorOutPut error = new ErrorOutPut(true, errorMessage, errorCode, uniqueId);
String jsonError = gson.toJson(error);
listenerManager.callOnError(jsonError, error);
showErrorLog(jsonError);
if (errorCode != ChatConstant.ERROR_CODE_CHAT_READY && errorCode != 21) {
if (sentryLog) {
SentryEvent event = new SentryEvent(new PodChatException(errorMessage, uniqueId, getToken()));
event.setEnvironment("PODCHAT");
event.setLevel(SentryLevel.ERROR);
event.setTag("FROM_SDK", "PODCHAT");
event.setExtra("CACHE ENABLED", " >>> " + cache);
Sentry.captureEvent(event, error);
}
}
if (log) {
Log.e(TAG, "ErrorMessage: " + errorMessage + " *Code* " + errorCode + " *uniqueId* " + uniqueId);
}
return jsonError;
}
use of io.sentry.core.SentryEvent in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method captureError.
protected String captureError(PodChatException exception) {
ErrorOutPut error = new ErrorOutPut(true, exception.getMessage(), exception.getCode(), exception.getUniqueId());
String jsonError = gson.toJson(error);
listenerManager.callOnError(jsonError, error);
showErrorLog(jsonError);
if (sentryLog) {
SentryEvent event = new SentryEvent(exception);
event.setEnvironment("PODCHAT");
event.setLevel(SentryLevel.ERROR);
event.setTag("FROM_SDK", "PODCHAT");
event.setExtra("CACHE ENABLED", " >>> " + cache);
Sentry.captureEvent(event, error);
}
return jsonError;
}
Aggregations