chore: Remove obsolete error toast custom message.

All patches that can encounter network errors now manage their own error toasts.
This commit is contained in:
LisoUseInAIKyrios 2024-11-03 14:59:03 -04:00 committed by oSumAtrIX
parent f9fa526b04
commit c7d9ccd13c
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 4 additions and 16 deletions

View File

@ -110,14 +110,7 @@ public class Logger {
* Logs exceptions under the outer class name of the code calling this method. * Logs exceptions under the outer class name of the code calling this method.
*/ */
public static void printException(@NonNull LogMessage message) { public static void printException(@NonNull LogMessage message) {
printException(message, null, null); printException(message, 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);
} }
/** /**
@ -128,10 +121,8 @@ public class Logger {
* *
* @param message log message * @param message log message
* @param ex exception (optional) * @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, public static void printException(@NonNull LogMessage message, @Nullable Throwable ex) {
@Nullable String userToastMessage) {
String messageString = message.buildMessageString(); String messageString = message.buildMessageString();
String outerClassSimpleName = message.findOuterClassSimpleName(); String outerClassSimpleName = message.findOuterClassSimpleName();
String logMessage = REVANCED_LOG_PREFIX + outerClassSimpleName; String logMessage = REVANCED_LOG_PREFIX + outerClassSimpleName;
@ -141,10 +132,7 @@ public class Logger {
Log.e(logMessage, messageString, ex); Log.e(logMessage, messageString, ex);
} }
if (DEBUG_TOAST_ON_ERROR.get()) { if (DEBUG_TOAST_ON_ERROR.get()) {
String toastMessageToDisplay = (userToastMessage != null) Utils.showToastLong(outerClassSimpleName + ": " + messageString);
? userToastMessage
: outerClassSimpleName + ": " + messageString;
Utils.showToastLong(toastMessageToDisplay);
} }
} }

View File

@ -302,7 +302,7 @@ public class ReturnYouTubeDislikeApi {
handleConnectionError((str("revanced_ryd_failure_generic", ex.getMessage())), ex, true); handleConnectionError((str("revanced_ryd_failure_generic", ex.getMessage())), ex, true);
} catch (Exception ex) { } catch (Exception ex) {
// should never happen // 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); updateRateLimitAndStats(timeNetworkCallStarted, true, false);