chore: Follow up database broken handling
This commit is contained in:
parent
eb9cf18d30
commit
8a9715cac2
1 changed files with 4 additions and 9 deletions
|
|
@ -23,15 +23,8 @@ Future<DatabaseApi> flutterMatrixSdkDatabaseBuilder(Client client) async {
|
||||||
database = await _constructDatabase(client);
|
database = await _constructDatabase(client);
|
||||||
await database.open();
|
await database.open();
|
||||||
return database;
|
return database;
|
||||||
} catch (e) {
|
} catch (e, s) {
|
||||||
// Try to delete database so that it can created again on next init:
|
Logs().wtf('Unable to build database!', e, s);
|
||||||
database?.delete().catchError(
|
|
||||||
(e, s) => Logs().w(
|
|
||||||
'Unable to delete database, after failed construction',
|
|
||||||
e,
|
|
||||||
s,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Send error notification:
|
// Send error notification:
|
||||||
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
|
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
|
||||||
|
|
@ -101,6 +94,8 @@ Future<MatrixSdkDatabase> _constructDatabase(Client client) async {
|
||||||
Logs().w('Unable to init database encryption', e, s);
|
Logs().w('Unable to init database encryption', e, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print('$path/${client.clientName}');
|
||||||
|
|
||||||
return MatrixSdkDatabase(
|
return MatrixSdkDatabase(
|
||||||
client.clientName,
|
client.clientName,
|
||||||
database: await openDatabase(
|
database: await openDatabase(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue