diff --git a/app/build.gradle b/app/build.gradle
index 551278d4..035b1f5e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,5 +1,6 @@
plugins {
id 'com.android.application'
+ id "io.sentry.android.gradle" version "4.7.1"
}
android {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8e2fed62..356f1ea0 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -50,6 +50,12 @@
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H"
android:value="598.0dip" />
+
+
+
+
{
+ options.setBeforeSend((event, hint) -> {
+ event.setUser(null);
+ event.getContexts().remove("device");
+ event.getContexts().put("device", new HashMap() {
+ {
+ put("model", android.os.Build.MODEL);
+ }
+ });
+ event.setEnvironment(BuildConfig.BUILD_TYPE);
+ return event;
+ });
+ });
+ }
}
diff --git a/app/src/main/java/com/perflyst/twire/activities/DeepLinkActivity.java b/app/src/main/java/com/perflyst/twire/activities/DeepLinkActivity.java
index a89a6168..73748e6b 100644
--- a/app/src/main/java/com/perflyst/twire/activities/DeepLinkActivity.java
+++ b/app/src/main/java/com/perflyst/twire/activities/DeepLinkActivity.java
@@ -26,6 +26,8 @@
import java.util.List;
import java.util.regex.Matcher;
+import io.sentry.Sentry;
+
public class DeepLinkActivity extends AppCompatActivity {
private int errorMessage = R.string.router_unknown_error;
@@ -49,7 +51,7 @@ public void onCreate(Bundle savedInstance) {
try {
intent = getNewIntent(params, paramSize);
} catch (Exception exception) {
- exception.printStackTrace();
+ Sentry.captureException(exception);
}
if (intent == null) {
diff --git a/app/src/main/java/com/perflyst/twire/activities/main/MainActivity.java b/app/src/main/java/com/perflyst/twire/activities/main/MainActivity.java
index e6f95d58..6186a290 100644
--- a/app/src/main/java/com/perflyst/twire/activities/main/MainActivity.java
+++ b/app/src/main/java/com/perflyst/twire/activities/main/MainActivity.java
@@ -38,6 +38,8 @@
import com.perflyst.twire.views.recyclerviews.AutoSpanRecyclerView;
import com.perflyst.twire.views.recyclerviews.auto_span_behaviours.AutoSpanBehaviour;
+import io.sentry.Sentry;
+
public abstract class MainActivity & MainElement> extends ThemeActivity {
private static final String FIRST_VISIBLE_ELEMENT_POSITION = "firstVisibleElementPosition";
@@ -469,7 +471,7 @@ public void onAnimationEnd(Animation animation) {
MainActivity.super.onBackPressed();
overridePendingTransition(0, 0);
} catch (IllegalStateException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
};
diff --git a/app/src/main/java/com/perflyst/twire/activities/setup/ConfirmSetupActivity.java b/app/src/main/java/com/perflyst/twire/activities/setup/ConfirmSetupActivity.java
index aeacef9b..fcdbf6e0 100644
--- a/app/src/main/java/com/perflyst/twire/activities/setup/ConfirmSetupActivity.java
+++ b/app/src/main/java/com/perflyst/twire/activities/setup/ConfirmSetupActivity.java
@@ -22,6 +22,7 @@
import io.codetail.animation.SupportAnimator;
import io.codetail.animation.ViewAnimationUtils;
+import io.sentry.Sentry;
public class ConfirmSetupActivity extends SetupBaseActivity {
private final int REVEAL_ANIMATION_DURATION = 650;
@@ -244,7 +245,7 @@ protected Void doInBackground(Void... params) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
return null;
diff --git a/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java b/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java
index 7d5d30a3..22a26686 100644
--- a/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java
+++ b/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java
@@ -39,6 +39,8 @@
import java.util.List;
import java.util.Set;
+import io.sentry.Sentry;
+
public abstract class StreamActivity extends ThemeActivity implements StreamFragment.StreamFragmentListener {
private final String LOG_TAG = getClass().getSimpleName();
public StreamFragment mStreamFragment;
@@ -126,7 +128,7 @@ public void onBackPressed() {
try {
mStreamFragment.backPressed();
} catch (NullPointerException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
this.overrideTransition();
}
diff --git a/app/src/main/java/com/perflyst/twire/adapters/ChatAdapter.java b/app/src/main/java/com/perflyst/twire/adapters/ChatAdapter.java
index 45adebcd..bf3b3fc9 100644
--- a/app/src/main/java/com/perflyst/twire/adapters/ChatAdapter.java
+++ b/app/src/main/java/com/perflyst/twire/adapters/ChatAdapter.java
@@ -41,6 +41,8 @@
import java.util.List;
import java.util.regex.Matcher;
+import io.sentry.Sentry;
+
/**
* Created by SebastianRask on 03-03-2016.
*/
@@ -139,7 +141,7 @@ public void onBindViewHolder(@NonNull final ContactViewHolder holder, int positi
} catch (Exception e) {
//In case twitch doesn't comply to their own API.
Log.d(LOG_TAG, "Failed to show Message");
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
diff --git a/app/src/main/java/com/perflyst/twire/adapters/PanelAdapter.java b/app/src/main/java/com/perflyst/twire/adapters/PanelAdapter.java
index 3298acae..84825b20 100644
--- a/app/src/main/java/com/perflyst/twire/adapters/PanelAdapter.java
+++ b/app/src/main/java/com/perflyst/twire/adapters/PanelAdapter.java
@@ -22,6 +22,8 @@
import java.util.ArrayList;
import java.util.List;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask on 24-02-2017.
*/
@@ -75,7 +77,7 @@ public void onBindViewHolder(@NonNull final PanelViewHolder holder, int position
mTabs.build().launchUrl(mActivity, Uri.parse(link));
} catch (ActivityNotFoundException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
});
}
diff --git a/app/src/main/java/com/perflyst/twire/chat/ChatEmoteManager.java b/app/src/main/java/com/perflyst/twire/chat/ChatEmoteManager.java
index 54df497b..bd95c592 100644
--- a/app/src/main/java/com/perflyst/twire/chat/ChatEmoteManager.java
+++ b/app/src/main/java/com/perflyst/twire/chat/ChatEmoteManager.java
@@ -21,6 +21,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import io.sentry.Sentry;
+
/**
* Created by sebastian on 26/07/2017.
*/
@@ -95,7 +97,7 @@ void loadCustomEmotes(EmoteFetchCallback callback) {
}
}
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
// FFZ emotes
@@ -148,7 +150,7 @@ void loadCustomEmotes(EmoteFetchCallback callback) {
}
}
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
// 7TV emotes
@@ -192,13 +194,13 @@ void loadCustomEmotes(EmoteFetchCallback callback) {
}
}
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
try {
callback.onEmoteFetched();
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
diff --git a/app/src/main/java/com/perflyst/twire/chat/ChatManager.java b/app/src/main/java/com/perflyst/twire/chat/ChatManager.java
index feb0c5fb..e45af72a 100644
--- a/app/src/main/java/com/perflyst/twire/chat/ChatManager.java
+++ b/app/src/main/java/com/perflyst/twire/chat/ChatManager.java
@@ -41,6 +41,8 @@
import javax.net.ssl.SSLSocketFactory;
+import io.sentry.Sentry;
+
public class ChatManager implements Runnable {
public static ChatManager instance = null;
@@ -247,7 +249,7 @@ private void connect(String address, int port) {
// If we reach this line then the socket closed but chat wasn't stopped, so reconnect.
if (!isStopping) connect(address, port);
} catch (IOException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
onUpdate(UpdateType.ON_CONNECTION_FAILED);
SystemClock.sleep(2500);
@@ -407,7 +409,7 @@ private void processVodChat() {
downloadedComments.poll();
}
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
onUpdate(UpdateType.ON_CONNECTION_FAILED);
SystemClock.sleep(2500);
@@ -567,7 +569,7 @@ private void sendRawMessage(String message) {
writer.write(message + " \r\n");
writer.flush();
} catch (IOException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
@@ -594,7 +596,7 @@ public void sendMessage(final String message) {
writer.flush();
}
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
@@ -627,7 +629,7 @@ private void readBadges(String url, Map> badgeMap) {
}
}
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
@@ -657,7 +659,7 @@ private void readFFZBadges() {
ffzBadgeMap = mapBuilder.build();
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
diff --git a/app/src/main/java/com/perflyst/twire/fragments/ChatFragment.java b/app/src/main/java/com/perflyst/twire/fragments/ChatFragment.java
index e33634c3..053c76f5 100644
--- a/app/src/main/java/com/perflyst/twire/fragments/ChatFragment.java
+++ b/app/src/main/java/com/perflyst/twire/fragments/ChatFragment.java
@@ -74,6 +74,8 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import io.sentry.Sentry;
+
interface EmoteKeyboardDelegate {
void onEmoteClicked(Emote clickedEmote, View view);
@@ -272,7 +274,7 @@ public void onCustomEmoteIdFetched(List channel, List global) {
customEmoteInfoLoaded(channel, global);
}
} catch (IllegalAccessError e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
@@ -790,7 +792,7 @@ public void onGlobalLayout() {
lastBottom = r.bottom;
}
} catch (IllegalStateException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
});
@@ -817,7 +819,7 @@ private void sendMessage() {
addMessage(chatMessage);
Log.d(LOG_TAG, "Message added");
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
},
diff --git a/app/src/main/java/com/perflyst/twire/fragments/StreamFragment.java b/app/src/main/java/com/perflyst/twire/fragments/StreamFragment.java
index 23318390..db18b8a5 100644
--- a/app/src/main/java/com/perflyst/twire/fragments/StreamFragment.java
+++ b/app/src/main/java/com/perflyst/twire/fragments/StreamFragment.java
@@ -126,6 +126,8 @@
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
+import io.sentry.Sentry;
+
@OptIn(markerClass = UnstableApi.class)
public class StreamFragment extends Fragment implements Player.Listener {
private static final int SHOW_TIMEOUT = 3000;
@@ -699,7 +701,7 @@ public void run() {
Utils.setNumber(mCurrentViewersView, currentViewers);
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}, mUserInfo.getUserId(), getContext()
);
@@ -1187,7 +1189,7 @@ private void startStreamWithTask() {
playbackFailed();
}
} catch (IllegalStateException | NullPointerException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
};
@@ -1214,7 +1216,7 @@ private void updateQualitySelectorsWithTask() {
qualityURLs = url;
}
} catch (IllegalStateException | NullPointerException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
};
diff --git a/app/src/main/java/com/perflyst/twire/model/ChannelInfo.java b/app/src/main/java/com/perflyst/twire/model/ChannelInfo.java
index 6914b3bf..02702d95 100644
--- a/app/src/main/java/com/perflyst/twire/model/ChannelInfo.java
+++ b/app/src/main/java/com/perflyst/twire/model/ChannelInfo.java
@@ -21,6 +21,8 @@
import java.net.URL;
import java.util.Objects;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask on 30-01-2015.
* This class is designed to hold all relevant information about a twitch user/streamer
@@ -59,7 +61,7 @@ public URL findUrl(String text) {
try {
return new URL(text);
} catch (MalformedURLException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
return null;
}
}
@@ -172,7 +174,7 @@ public Integer fetchFollowers(Context context) {
followers = fullDataObject.getInt("total");
return followers;
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
return null;
}
}
diff --git a/app/src/main/java/com/perflyst/twire/model/SleepTimer.java b/app/src/main/java/com/perflyst/twire/model/SleepTimer.java
index 77f545b7..cb0ac457 100644
--- a/app/src/main/java/com/perflyst/twire/model/SleepTimer.java
+++ b/app/src/main/java/com/perflyst/twire/model/SleepTimer.java
@@ -11,6 +11,8 @@
import com.perflyst.twire.service.DialogService;
import com.perflyst.twire.service.Settings;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask Jepsen on 22/07/16.
*/
@@ -42,7 +44,7 @@ public void run() {
sleepTimerHandler.postDelayed(this, 1000 * 60);
}
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
Log.e(LOG_TAG, "Sleep Timer runnable failed");
}
}
diff --git a/app/src/main/java/com/perflyst/twire/model/VideoOnDemand.java b/app/src/main/java/com/perflyst/twire/model/VideoOnDemand.java
index e8d31de2..b893532f 100644
--- a/app/src/main/java/com/perflyst/twire/model/VideoOnDemand.java
+++ b/app/src/main/java/com/perflyst/twire/model/VideoOnDemand.java
@@ -11,6 +11,8 @@
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask on 16-06-2016.
*/
@@ -98,7 +100,7 @@ private void setRecordedAtDate(String recordedAtString) {
try {
this.recordedAt = ZonedDateTime.parse(recordedAtString);
} catch (DateTimeParseException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
diff --git a/app/src/main/java/com/perflyst/twire/service/Service.java b/app/src/main/java/com/perflyst/twire/service/Service.java
index 50706137..59dddb17 100644
--- a/app/src/main/java/com/perflyst/twire/service/Service.java
+++ b/app/src/main/java/com/perflyst/twire/service/Service.java
@@ -62,6 +62,7 @@
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
+import io.sentry.Sentry;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
@@ -340,7 +341,7 @@ public static void increaseNavigationDrawerEdge(DrawerLayout aDrawerLayout) {
mEdgeSize.setInt(draggerObj, edgeSize); //optimal value as for me, you may set any constant in dp
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
@@ -406,9 +407,9 @@ public static ImageButton getNavButtonView(Toolbar toolbar) {
return (ImageButton) navButtonField.get(toolbar);
} catch (IllegalAccessException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
} catch (NoSuchFieldException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
return null;
@@ -494,7 +495,7 @@ public static JSONObject graphQL(String operation, String hash, Map getStreamerInfoFromDB(Context context) {
} catch (MalformedURLException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
// Create new StreamerInfo object from data fetched from database
@@ -677,7 +678,7 @@ private static void updateStreamerInfoDbWithValues(ContentValues values, Context
db.close();
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
diff --git a/app/src/main/java/com/perflyst/twire/service/SubscriptionsDbHelper.java b/app/src/main/java/com/perflyst/twire/service/SubscriptionsDbHelper.java
index ec6e0ed9..867c3243 100644
--- a/app/src/main/java/com/perflyst/twire/service/SubscriptionsDbHelper.java
+++ b/app/src/main/java/com/perflyst/twire/service/SubscriptionsDbHelper.java
@@ -23,6 +23,8 @@
import java.io.InputStreamReader;
import java.util.ArrayList;
+import io.sentry.Sentry;
+
/**
* Created by SebastianRask on 27-01-2015.
* Helper for creating and maintaining our database for StreamerInfo objects
@@ -79,7 +81,7 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
new Settings(mContext).setUsersNotToNotifyWhenLive(getUsersNotToNotify(db));
}
} catch (SQLiteException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
@@ -172,7 +174,7 @@ public int onImport(SQLiteDatabase db) {
}
return channels.length();
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
return 0;
}
@@ -223,7 +225,7 @@ public int onExport(SQLiteDatabase db) {
tempchannel.put("IS_TWITCH", isTwitch);
channelstoExport.put(tempchannel);
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
cursor.close();
@@ -238,7 +240,7 @@ public int onExport(SQLiteDatabase db) {
create(mContext, EXPORT_NAME, jsonStr);
return channelstoExport.length();
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
return 0;
@@ -274,7 +276,7 @@ private void create(Context context, String fileName, String jsonString) {
fos.write(jsonString.getBytes());
fos.close();
} catch (IOException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
}
diff --git a/app/src/main/java/com/perflyst/twire/tasks/ConstructChatMessageTask.java b/app/src/main/java/com/perflyst/twire/tasks/ConstructChatMessageTask.java
index ec9bb73c..bb746576 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/ConstructChatMessageTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/ConstructChatMessageTask.java
@@ -13,6 +13,8 @@
import java.util.List;
import java.util.function.Consumer;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask Jepsen on 07/08/16.
*/
@@ -46,7 +48,7 @@ protected ChatMessage doInBackground(Void... voids) {
false
);
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
return null;
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetLiveStreamURL.java b/app/src/main/java/com/perflyst/twire/tasks/GetLiveStreamURL.java
index e2ec7745..7a92c344 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetLiveStreamURL.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetLiveStreamURL.java
@@ -18,6 +18,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import io.sentry.Sentry;
import okhttp3.Request;
/**
@@ -62,7 +63,7 @@ protected LinkedHashMap doInBackground(String... params) {
Log.d("ACCESS_TOKEN_STRING", token);
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
String streamUrl = String.format("http://usher.ttvnw.net/api/channel/hls/%s.m3u8" +
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetPanelsTask.java b/app/src/main/java/com/perflyst/twire/tasks/GetPanelsTask.java
index 98e777b8..8d89644e 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetPanelsTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetPanelsTask.java
@@ -60,7 +60,7 @@ protected List doInBackground(Void... voids) {
}
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
*/
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetStreamChattersTask.java b/app/src/main/java/com/perflyst/twire/tasks/GetStreamChattersTask.java
index a0d41220..fae0b234 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetStreamChattersTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetStreamChattersTask.java
@@ -9,6 +9,8 @@
import java.util.ArrayList;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask on 22-01-2017.
*/
@@ -31,7 +33,7 @@ protected ArrayList doInBackground(Void... voids) {
return null;
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
return null;
}
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetStreamViewersTask.java b/app/src/main/java/com/perflyst/twire/tasks/GetStreamViewersTask.java
index c4baed04..dc7ae60f 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetStreamViewersTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetStreamViewersTask.java
@@ -11,6 +11,8 @@
import java.util.function.Consumer;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask on 17-09-2016.
*/
@@ -38,7 +40,7 @@ protected Integer doInBackground(Void... voids) {
return streamObject.getInt(VIEWERS_INT);
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
return -1;
}
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetStreamsCountTask.java b/app/src/main/java/com/perflyst/twire/tasks/GetStreamsCountTask.java
index 14dd7729..4adddcf7 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetStreamsCountTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetStreamsCountTask.java
@@ -13,6 +13,8 @@
import java.util.ArrayList;
import java.util.function.Consumer;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask on 26-06-2016.
*/
@@ -86,7 +88,7 @@ protected Integer doInBackground(Void... params) {
// return the length of the array
return final_array.length();
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
return -1;
}
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetTwitchEmotesTask.java b/app/src/main/java/com/perflyst/twire/tasks/GetTwitchEmotesTask.java
index 6ba50a12..6943ae7f 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetTwitchEmotesTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetTwitchEmotesTask.java
@@ -17,6 +17,8 @@
import java.util.Collections;
import java.util.List;
+import io.sentry.Sentry;
+
/**
* Created by idealMJ on 29/07/16.
*/
@@ -53,7 +55,7 @@ protected Void doInBackground(Void... voids) {
}
}
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
Collections.sort(twitchEmotes);
return null;
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetTwitchUserFollows.java b/app/src/main/java/com/perflyst/twire/tasks/GetTwitchUserFollows.java
index d04501b5..a0c06d39 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetTwitchUserFollows.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetTwitchUserFollows.java
@@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
+import io.sentry.Sentry;
import okhttp3.Request;
/**
@@ -116,7 +117,7 @@ protected ArrayList doInBackground(Object... params) {
try {
thread.join();
} catch (InterruptedException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
}
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetVODStreamURL.java b/app/src/main/java/com/perflyst/twire/tasks/GetVODStreamURL.java
index 703d92aa..f5d33f9d 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetVODStreamURL.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetVODStreamURL.java
@@ -12,6 +12,8 @@
import java.util.Map;
import java.util.function.Consumer;
+import io.sentry.Sentry;
+
/**
* Created by Sebastian Rask on 18-06-2016.
*/
@@ -38,7 +40,7 @@ protected LinkedHashMap doInBackground(String... params) {
token = tokenJSON.getString("value");
signature = tokenJSON.getString("signature");
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
String vodURL = String.format("http://usher.ttvnw.net/vod/%s?allow_source=true&nauthsig=%s&nauth=%s", vodId, signature, Utils.safeEncode(token));
diff --git a/app/src/main/java/com/perflyst/twire/tasks/GetVisualElementsTask.java b/app/src/main/java/com/perflyst/twire/tasks/GetVisualElementsTask.java
index 89827f22..97130b4b 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/GetVisualElementsTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/GetVisualElementsTask.java
@@ -8,6 +8,8 @@
import java.util.ArrayList;
import java.util.List;
+import io.sentry.Sentry;
+
public class GetVisualElementsTask extends AsyncTask> {
private final LazyFetchingActivity mLazyActivity;
private final String LOG_TAG = getClass().getSimpleName();
@@ -24,7 +26,7 @@ protected final List doInBackground(Void... params) {
try {
resultList = mLazyActivity.getVisualElements();
} catch (Exception e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
return resultList;
diff --git a/app/src/main/java/com/perflyst/twire/tasks/ValidateOauthTokenTask.java b/app/src/main/java/com/perflyst/twire/tasks/ValidateOauthTokenTask.java
index f11b8e50..da5c929c 100644
--- a/app/src/main/java/com/perflyst/twire/tasks/ValidateOauthTokenTask.java
+++ b/app/src/main/java/com/perflyst/twire/tasks/ValidateOauthTokenTask.java
@@ -16,6 +16,7 @@
import java.lang.ref.WeakReference;
import java.util.function.Consumer;
+import io.sentry.Sentry;
import okhttp3.Request;
/**
@@ -74,7 +75,7 @@ protected TokenValidation doInBackground(Void... params) {
return new TokenValidation(user_id);
} catch (JSONException e) {
- e.printStackTrace();
+ Sentry.captureException(e);
}
if (isNetworkConnectedThreadOnly(context.get())) {