ToString() public method

public ToString ( ) : string
return string
Example #1
0
        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;
        }
Example #2
0
 /// <summary>  
 /// Creates a <c>ParseException</c> with <c>e</c>s detail message.
 /// </summary>
 /// <param name="e">An exception that occurred while a <c>WKTReader</c> was
 /// parsing a Well-known Text string.</param>
 public ParseException(Exception e) : this(e.ToString()) { }