Exemple #1
0
        /// <summary>
        /// Throws the exception if the value represents a light exception
        /// </summary>
        public static object CheckAndThrow(object value)
        {
            LightException lightEx = value as LightException;

            if (lightEx != null)
            {
                ThrowException(lightEx);
            }
            return(value);
        }
Exemple #2
0
        /// <summary>
        /// Gets the light exception from an object which may contain a light
        /// exception.  Returns null if the object is not a light exception.
        ///
        /// Used for throwing the exception at non-light exception boundaries.
        /// </summary>
        public static Exception GetLightException(object exceptionValue)
        {
            LightException lightEx = exceptionValue as LightException;

            if (lightEx != null)
            {
                return(lightEx.Exception);
            }

            return(null);
        }
Exemple #3
0
        /// <summary>
        /// Gets the light exception from an object which may contain a light
        /// exception.  Returns null if the object is not a light exception.
        ///
        /// Used for throwing the exception at non-light exception boundaries.
        /// </summary>
        public static Exception GetLightException(object exceptionValue)
        {
            LightException lightEx = exceptionValue as LightException;

            return(lightEx?.Exception);
        }
Exemple #4
0
 private static void ThrowException(LightException lightEx)
 {
     throw lightEx.Exception;
 }
Exemple #5
0
 private static void ThrowException(LightException lightEx) {
     throw lightEx.Exception;
 }