Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions sentry-android/src/main/java/com/joshdholtz/sentry/Sentry.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.UUID;
import java.util.regex.Pattern;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
Expand Down Expand Up @@ -98,10 +98,8 @@ public class Sentry {
private Map<String, Object> contexts = Collections.emptyMap();

private static final String TAG = "Sentry";
private static final String DEFAULT_BASE_URL = "https://app.getsentry.com";

private Sentry() {

}

private static void log(String text) {
Expand Down Expand Up @@ -234,14 +232,18 @@ public static void captureMessage(String message, SentryEventLevel level) {
}

public static void captureException(Throwable t) {
Sentry.captureException(t, SentryEventLevel.ERROR);
Sentry.captureException(t, t.getMessage(), SentryEventLevel.ERROR);
}

public static void captureException(Throwable t, String message) {
Sentry.captureException(t, message, SentryEventLevel.ERROR);
}

public static void captureException(Throwable t, SentryEventLevel level) {
public static void captureException(Throwable t, String message, SentryEventLevel level) {
String culprit = getCause(t, t.getMessage());

Sentry.captureEvent(new SentryEventBuilder()
.setMessage(t.getMessage())
.setMessage(message)
.setCulprit(culprit)
.setLevel(level)
.setException(t)
Expand Down Expand Up @@ -689,7 +691,7 @@ public static class SentryEventBuilder implements Serializable {
// dalvik.system.*
static final String isInternalPackage = "^(java|android|com\\.android|com\\.google\\.android|dalvik\\.system)\\..*";

private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ this fixes a warning in AndroidStudio

static {
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
}
Expand All @@ -700,7 +702,7 @@ public JSONObject toJSON() {
return new JSONObject(event);
}

public static enum SentryEventLevel {
public enum SentryEventLevel {

FATAL("fatal"),
ERROR("error"),
Expand Down