예제 #1
0
        /// <summary>
        /// Converts from a LangException to LError datatype
        /// </summary>
        /// <param name="exc">The exception to convert to an LError</param>
        /// <returns></returns>
        public static LError FromException(Exception exc)
        {
            LError error = null;

            if (exc is LangException)
            {
                var ex = exc as LangException;
                // Create new instance of language error.
                error = new LError()
                {
                    LineNumber = ex.Error.Line,
                    name       = ex.Error.Message,
                    message    = ex.Message,
                    Source     = ex.Error.File,
                    StackTrace = ex.StackTrace
                };
                return(error);
            }
            // Create new instance of language error.
            error            = new LError();
            error.name       = string.Empty;
            error.message    = exc.Message;
            error.StackTrace = exc.StackTrace;
            return(error);
        }
예제 #2
0
파일: LError.cs 프로젝트: GHLabs/SambaPOS-3
 /// <summary>
 /// Converts from a LangException to LError datatype
 /// </summary>
 /// <param name="exc">The exception to convert to an LError</param>
 /// <returns></returns>
 public static LError FromException(Exception exc)
 {
     LError error = null;
     if (exc is LangException)
     {
         var ex = exc as LangException;
         // Create new instance of language error.
         error = new LError()
         {
             LineNumber = ex.Error.Line,
             name = ex.Error.Message,
             message = ex.Message,
             Source = ex.Error.File,
             StackTrace = ex.StackTrace
         };
         return error;
     }
     // Create new instance of language error.
     error = new LError();
     error.name = string.Empty;
     error.message = exc.Message;
     error.StackTrace = exc.StackTrace;
     return error;
 }