mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-28 12:03:45 +01:00 
			
		
		
		
	Only show host+path for ClientException log (#714)
This commit is contained in:
		| @@ -3,6 +3,7 @@ import 'dart:math'; | ||||
|  | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter/services.dart'; | ||||
| import 'package:http/http.dart'; | ||||
| import 'package:obtainium/custom_errors.dart'; | ||||
| import 'package:obtainium/pages/home.dart'; | ||||
| import 'package:obtainium/providers/apps_provider.dart'; | ||||
| @@ -101,10 +102,15 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async { | ||||
|       await appsProvider.checkUpdates( | ||||
|           ignoreAppsCheckedAfter: ignoreAfter, throwErrorsForRetry: true); | ||||
|     } catch (e) { | ||||
|       if (e is RateLimitError || e is SocketException) { | ||||
|       if (e is RateLimitError || e is ClientException) { | ||||
|         var remainingMinutes = e is RateLimitError ? e.remainingMinutes : 15; | ||||
|         logs.add(plural('bgUpdateGotErrorRetryInMinutes', remainingMinutes, | ||||
|             args: [e.toString(), remainingMinutes.toString()])); | ||||
|         logs.add( | ||||
|             plural('bgUpdateGotErrorRetryInMinutes', remainingMinutes, args: [ | ||||
|           e is ClientException | ||||
|               ? '${(e).message}, ${e.uri?.path}' | ||||
|               : e.toString(), | ||||
|           remainingMinutes.toString() | ||||
|         ])); | ||||
|         AndroidAlarmManager.oneShot(Duration(minutes: remainingMinutes), | ||||
|             Random().nextInt(pow(2, 31) as int), bgUpdateCheck, params: { | ||||
|           'ignoreAfterMicroseconds': nextIgnoreAfter.microsecondsSinceEpoch | ||||
|   | ||||
		Reference in New Issue
	
	Block a user