Beispiel #1
0
 public static void LogErrorNow(
     Exception e,
     int portIndex       = 1,
     bool forceException = true)
 {
     Errors.GetInstance()._LogErrorNow(e, portIndex);
     Errors.LaunchException(e, forceException);
 }
Beispiel #2
0
 /// <summary>
 /// Registers a new error based on an exception, shows a popup alert using
 /// this last error and also registers in the ( activity or result ) log file
 /// </summary>
 /// <param name="e">Exception that represents the last error happened</param>
 /// <param name="portIndex">Index of MTU port associated to the error</param>
 /// <param name="forceException">Forces to launch/throw the exception</param>
 public static void LogErrorNow(
     Exception e,
     int portIndex       = -1,
     bool forceException = true)
 {
     if (!IsOwnException(e))
     {
         Errors.GetInstance()._LogErrorNow(e, portIndex, forceException);
     }
     else
     {
         Errors.GetInstance()._LogErrorNow(e, ((portIndex > -1) ? portIndex : (( OwnExceptionsBase )e).Port), forceException);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Both options will log all registered exceptions that remain, but in
        /// the first case previously the last exception launched will be added
        /// </summary>
        /// <param name="e">Exception that represents the last error happened</param>
        public static void LogRemainExceptions(
            Exception e)
        {
            // Last exception was not added yet
            if (!Errors.GetInstance().IsLastExceptionUsed(e))
            {
                Errors.LogErrorNow(e, -1, false);
            }

            // Last exception was already added
            else
            {
                Errors.LogRegisteredErrors();
            }
        }
Beispiel #4
0
 public async static Task ShowAlert(
     Exception e)
 {
     await Errors.GetInstance()._ShowAlert(e);
 }
Beispiel #5
0
 public static void LogRegisteredErrors(
     bool forceException = false)
 {
     Errors.GetInstance()._LogRegisteredErrors(forceException);
 }
Beispiel #6
0
 /// <summary>
 /// Used during the initialization process, when the app
 /// is not loaded yet and the error forces to close the app
 /// </summary>
 /// <param name="e">Exception that represents the last error happened</param>
 public static void LogErrorNowAndKill(
     Exception e)
 {
     Errors.GetInstance()._LogErrorNow(e, 1, false, true);     // Port index has not importance in this case
 }
Beispiel #7
0
 /// <summary>
 /// Registers a new error based on an ( own or .Net ) exception
 /// </summary>
 /// <param name="e">Exception that represents the last error happened</param>
 /// <param name="portIndex">MTU port index related</param>
 public static void AddError(
     Exception e,
     int portIndex = 1)
 {
     Errors.GetInstance().AddErrorByException(e, portIndex);
 }
Beispiel #8
0
 /// <summary>
 /// Gets all errors registered to log, used from class Logger
 /// </summary>
 /// <returns>Array of registered errors</returns>
 /// <param name="clearList">Clear list of registered errors after being returned</param>
 public static Error[] GetErrorsToLog(
     bool clearList = true)
 {
     return(Errors.GetInstance()._GetErrorsToLog(clearList));
 }