V4.6.1 report fixes (#859)

* Add exception handler to anypay api response failure

* Check if context is still mounted before fetching iPad position

* Add user connection issue to ignored errors

* Wrap launchURL in empty try catch to avoid package un-needed exceptions
This commit is contained in:
Omar Hatem 2023-03-31 21:14:22 +02:00 committed by GitHub
parent 72df78ad8c
commit 37ef63d09e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 16 deletions

View file

@ -1,5 +1,6 @@
import 'dart:convert';
import 'package:cake_wallet/anypay/any_pay_payment_committed_info.dart';
import 'package:cake_wallet/utils/exception_handler.dart';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart';
import 'package:cw_core/crypto_currency.dart';
@ -55,6 +56,7 @@ class AnyPayApi {
final response = await post(url, headers: headers, body: utf8.encode(json.encode(body)));
if (response.statusCode != 200) {
ExceptionHandler.onError(FlutterErrorDetails(exception: response));
throw Exception('Unexpected response http code: ${response.statusCode}');
}