@@ -124,8 +124,8 @@ class DatabaseManager {
124124 await _database! .rawQuery ("SELECT sqlcipher_export('tmp')" );
125125 await _database! .rawQuery ("DETACH DATABASE tmp" );
126126 return true ;
127- } catch (e) {
128- ILogger .error ("Failed to change database password" , e);
127+ } catch (e, t ) {
128+ ILogger .error ("Failed to change database password" , e, t );
129129 return false ;
130130 }
131131 }
@@ -143,9 +143,7 @@ class DatabaseManager {
143143 "Configure database with cipher successfully. Result is $res " );
144144 } else {
145145 ILogger .error (
146- "Failed to configure database with cipher, perhaps the sqlcipher dynamic library was not loaded." ,
147- res,
148- );
146+ "Failed to configure database with cipher, perhaps the sqlcipher dynamic library was not loaded. Result is $res " );
149147 }
150148 }
151149 }
@@ -265,7 +263,11 @@ class DatabaseManager {
265263 if (Platform .isLinux || Platform .isAndroid) {
266264 try {
267265 lib = DynamicLibrary .open ('libsqlcipher.so' );
268- } catch (e) {
266+ } catch (e, t) {
267+ ILogger .error (
268+ "Failed to load libsqlcipher.so, perhaps the library is not installed or not in the correct path." ,
269+ e,
270+ t);
269271 if (Platform .isAndroid) {
270272 final appIdAsBytes = File ('/proc/self/cmdline' ).readAsBytesSync ();
271273 final endOfAppId = max (appIdAsBytes.indexOf (0 ), 0 );
@@ -284,7 +286,8 @@ class DatabaseManager {
284286 lib = DynamicLibrary .open ('sqlite_sqlcipher.dll' );
285287 }
286288 return lib;
287- } catch (e) {
289+ } catch (e, t) {
290+ ILogger .error ("Failed to load sqlcipher dynamic library" , e, t);
288291 return null ;
289292 }
290293 }
0 commit comments