mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
[auth] Surface more information about importError on UI
This commit is contained in:
parent
26cbc5a2f0
commit
1f33df7147
@ -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()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user