/// <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); }
/// <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); }
/// <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); }
private static void ThrowException(LightException lightEx) { throw lightEx.Exception; }