[auth] Surface more information about importError on UI (#1954)
## Description Surfacing error information on UI. This is to reduce the to and fro between customer and support as error logging isn't enabled by default. Also, added missing logs at certain places. ## Tests
This commit is contained in:
@@ -76,7 +76,7 @@ Future<void> _pickAegisJsonFile(BuildContext context) async {
|
||||
await showErrorDialog(
|
||||
context,
|
||||
context.l10n.sorry,
|
||||
context.l10n.importFailureDesc,
|
||||
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ Future<int?> _processAegisExportFile(
|
||||
otpUrl =
|
||||
'otpauth://$kind/$issuer:$account?secret=$secret&issuer=$issuer&algorithm=$algorithm&digits=$digits&counter=$counter';
|
||||
} else {
|
||||
throw Exception('Invalid OTP type');
|
||||
throw Exception('Invalid OTP type: $kind');
|
||||
}
|
||||
parsedCodes.add(Code.fromOTPAuthUrl(otpUrl));
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'package:ente_auth/utils/dialog_util.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
Future<void> showBitwardenImportInstruction(BuildContext context) async {
|
||||
final l10n = context.l10n;
|
||||
@@ -60,12 +61,13 @@ Future<void> _pickBitwardenJsonFile(BuildContext context) async {
|
||||
if (count != null) {
|
||||
await importSuccessDialog(context, count);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e,s) {
|
||||
Logger("BitwardenImport").severe('Failed to import',e,s);
|
||||
await progressDialog.hide();
|
||||
await showErrorDialog(
|
||||
context,
|
||||
context.l10n.sorry,
|
||||
context.l10n.importFailureDesc,
|
||||
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +92,6 @@ Future<int?> _processBitwardenExportFile(
|
||||
} else {
|
||||
var issuer = item['name'];
|
||||
var account = item['login']['username'];
|
||||
|
||||
code = Code.fromAccountAndSecret(
|
||||
Type.totp,
|
||||
account,
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'package:ente_auth/utils/dialog_util.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
Future<void> showLastpassImportInstruction(BuildContext context) async {
|
||||
final l10n = context.l10n;
|
||||
@@ -60,12 +61,13 @@ Future<void> _pickLastpassJsonFile(BuildContext context) async {
|
||||
if (count != null) {
|
||||
await importSuccessDialog(context, count);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e, s) {
|
||||
Logger('LastPassImport').severe('exception while processing import', e, s);
|
||||
await progressDialog.hide();
|
||||
await showErrorDialog(
|
||||
context,
|
||||
context.l10n.sorry,
|
||||
context.l10n.importFailureDesc,
|
||||
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'package:ente_auth/utils/dialog_util.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
Future<void> showRaivoImportInstruction(BuildContext context) async {
|
||||
final l10n = context.l10n;
|
||||
@@ -60,12 +61,13 @@ Future<void> _pickRaivoJsonFile(BuildContext context) async {
|
||||
if (count != null) {
|
||||
await importSuccessDialog(context, count);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e, s) {
|
||||
Logger("RaivoImport").severe('Failed to import', e, s);
|
||||
await progressDialog.hide();
|
||||
await showErrorDialog(
|
||||
context,
|
||||
context.l10n.sorry,
|
||||
context.l10n.importFailureDesc,
|
||||
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ Future<void> _pick2FasFile(BuildContext context) async {
|
||||
await showErrorDialog(
|
||||
context,
|
||||
context.l10n.sorry,
|
||||
context.l10n.importFailureDesc,
|
||||
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: ente_auth
|
||||
description: ente two-factor authenticator
|
||||
version: 3.0.4+304
|
||||
version: 3.0.5+305
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user