private Exception LogAndConvertJavaException(Exception e)
{
Kp2aLog.Log(e.Message);
if (e is UserInteractionRequiredException)
return e;
//seems like UserInteractionRequiredException is not propagated correctly into the C# world, we can't catch it
// -> rethrow correctly here
// Note: the Contains-check looks a bit broad, but it should be safe
if (e.ToString().Contains("keepass2android.javafilestorage.UserInteractionRequiredException"))
{
throw new UserInteractionRequiredException();
}
Java.Lang.Exception exception = e as Java.Lang.Exception;
if (exception != null)
{
var ex = new Exception(exception.LocalizedMessage ??
e.Message ??
_app.GetResourceString(UiStringKey.ErrorOcurred) + exception.GetType().Name, e);
return ex;
}
return e;
}