Skip to content

Commit

Permalink
chore: Remove obsolete error toast custom message.
Browse files Browse the repository at this point in the history
All patches that can encounter network errors now manage their own error toasts.
  • Loading branch information
LisoUseInAIKyrios authored and oSumAtrIX committed Nov 6, 2024
1 parent f9fa526 commit c7d9ccd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,7 @@ public static void printInfo(@NonNull LogMessage message, @Nullable Exception ex
* Logs exceptions under the outer class name of the code calling this method.
*/
public static void printException(@NonNull LogMessage message) {
printException(message, null, null);
}

/**
* Logs exceptions under the outer class name of the code calling this method.
*/
public static void printException(@NonNull LogMessage message, @Nullable Throwable ex) {
printException(message, ex, null);
printException(message, null);
}

/**
Expand All @@ -128,10 +121,8 @@ public static void printException(@NonNull LogMessage message, @Nullable Throwab
*
* @param message log message
* @param ex exception (optional)
* @param userToastMessage user specific toast message to show instead of the log message (optional)
*/
public static void printException(@NonNull LogMessage message, @Nullable Throwable ex,
@Nullable String userToastMessage) {
public static void printException(@NonNull LogMessage message, @Nullable Throwable ex) {
String messageString = message.buildMessageString();
String outerClassSimpleName = message.findOuterClassSimpleName();
String logMessage = REVANCED_LOG_PREFIX + outerClassSimpleName;
Expand All @@ -141,10 +132,7 @@ public static void printException(@NonNull LogMessage message, @Nullable Throwab
Log.e(logMessage, messageString, ex);
}
if (DEBUG_TOAST_ON_ERROR.get()) {
String toastMessageToDisplay = (userToastMessage != null)
? userToastMessage
: outerClassSimpleName + ": " + messageString;
Utils.showToastLong(toastMessageToDisplay);
Utils.showToastLong(outerClassSimpleName + ": " + messageString);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public static RYDVoteData fetchVotes(String videoId) {
handleConnectionError((str("revanced_ryd_failure_generic", ex.getMessage())), ex, true);
} catch (Exception ex) {
// should never happen
Logger.printException(() -> "Failed to fetch votes", ex, str("revanced_ryd_failure_generic", ex.getMessage()));
Logger.printException(() -> "fetchVotes failure", ex);
}

updateRateLimitAndStats(timeNetworkCallStarted, true, false);
Expand Down

0 comments on commit c7d9ccd

Please sign in to comment.