Skip to content

Commit

Permalink
separate CI steps more clearly
Browse files Browse the repository at this point in the history
Add more info to error reports
  • Loading branch information
OmarHatem28 committed Dec 10, 2024
1 parent 5553d5c commit 35cf4a7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/pr_test_build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ jobs:
sudo apt update
sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang
- name: Clone Repo
run: |
sudo mkdir -p /opt/android
sudo chown $USER /opt/android
cd /opt/android
git clone https://github.com/cake-tech/cake_wallet.git --branch ${{ env.BRANCH_NAME }}
- name: Cache Keystore
id: cache-keystore
uses: actions/cache@v3
Expand All @@ -76,12 +84,9 @@ jobs:
- name: Execute Build and Setup Commands
run: |
sudo mkdir -p /opt/android
sudo chown $USER /opt/android
cd /opt/android
-y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install cargo-ndk
git clone https://github.com/cake-tech/cake_wallet.git --branch ${{ env.BRANCH_NAME }}
cd cake_wallet/scripts/android/
./install_ndk.sh
source ./app_env.sh cakewallet
Expand Down
5 changes: 3 additions & 2 deletions lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ class TOTPEnterCode extends BasePage {
},
);
if (isForSetup && result) {
Navigator.pushReplacementNamed(
context, Routes.modify2FAPage);
if (context.mounted) {
Navigator.pushReplacementNamed(context, Routes.modify2FAPage);
}
}

},
Expand Down
14 changes: 14 additions & 0 deletions lib/utils/exception_handler.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'dart:io';

import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/entities/preferences_key.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/main.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cw_core/root_dir.dart';
Expand All @@ -29,9 +31,21 @@ class ExceptionHandler {
_file = File('${appDocDir.path}/error.txt');
}

String? walletType;
CustomTrace? programInfo;

try {
walletType = getIt.get<AppStore>().wallet?.type.name;

programInfo = CustomTrace(stackTrace ?? StackTrace.current);
} catch (_) {}

final exception = {
"${DateTime.now()}": {
"Error": "$error\n\n",
"WalletType": "$walletType\n\n",
"VerboseLog":
"${programInfo?.fileName}#${programInfo?.lineNumber}:${programInfo?.columnNumber} ${programInfo?.callerFunctionName}\n\n",
"Library": "$library\n\n",
"StackTrace": stackTrace.toString(),
}
Expand Down

0 comments on commit 35cf4a7

Please sign in to comment.