aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-05-21 08:23:26 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-05-21 08:23:26 -0600
commit377487c04e1e1dc0636f923e0405911f853f1521 (patch)
treec599150fc3ab81c79d66e50b3fdc12d5d9e2e58c /app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java
parente700953ebbe12d1af8d786eb9250e39ad5fc3ef5 (diff)
downloadwiimmfi-watcher-377487c04e1e1dc0636f923e0405911f853f1521.tar
wiimmfi-watcher-377487c04e1e1dc0636f923e0405911f853f1521.tar.gz
wiimmfi-watcher-377487c04e1e1dc0636f923e0405911f853f1521.tar.bz2
added a new error if jsoup throws exception
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java
index 2c17476..8de81f9 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java
@@ -14,7 +14,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.Arrays;
import me.brysonsteck.wiimmfiwatcher.R;
@@ -44,6 +46,13 @@ public class RoomFragment extends Fragment {
if (header == null) {
header = "This player is not online, not inside a room or does not exist. Click the refresh button to try again, or click on the back button to enter a different friend code.";
}
+ if (roomData.error != null) {
+ header = "Wiimmfi Watcher was unable to connect to the Wiimmfi servers. This could be that you are not connected to the internet, but it could be something else. Here was the error:\n\n" +
+ roomData.error.getMessage() + "\n\n" +
+ "If the error is along the lines of \"Unable to resolve host\" or \"Timeout\", you are probably having internet issues. Make sure you are connected to the internet then click the refresh button or press back to watch a new friend code.\n\n" +
+ "If the error is something other than that or if the error persists, make sure that Wiimmfi's website is currently running. Otherwise, please screenshot this screen and submit a bug report by clicking the About icon on the main page.";
+
+ }
headerTextView.setText(header);
RecyclerView recyclerView = view.findViewById(R.id.player_data_recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
@@ -59,6 +68,12 @@ public class RoomFragment extends Fragment {
if (header == null) {
header = "This player is not online, not inside a room or does not exist. Click the refresh button to try again, or click on the back button to enter a different friend code.";
}
+ if (newRoomData.error instanceof java.net.SocketTimeoutException || newRoomData.error instanceof java.net.UnknownHostException) {
+ header = "Wiimmfi Watcher was unable to connect to the Wiimmfi servers. This could be that you are not connected to the internet, but it could be something else. Here was the error:\n\n" +
+ roomData.error.getMessage() + "\n\n" +
+ "If the error is along the lines of \"Unable to resolve host\" or \"Timeout\", you are probably having internet issues. Make sure you are connected to the internet then click the refresh button or press back to watch a new friend code.\n\n" +
+ "If the error is something other than that or if the error persists, make sure that Wiimmfi's website is currently running. Otherwise, please screenshot this screen and submit a bug report by clicking the About icon on the main page.";
+ }
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(new RoomAdapter(display, playerLink, header, players, getContext()));