using System; namespace UnityEngine.Rendering.PostProcessing { static class PostProcessEffectRendererExtensions { /// /// Render with a try catch for all exception. /// /// If an exception occurs during the call, it will be logged /// and returned. /// /// Use this method instead of in critical contexts /// to avoid entering the exception flow. /// /// The renderer to render. /// A context object /// public static Exception RenderOrLog(this PostProcessEffectRenderer self, PostProcessRenderContext context) { try { self.Render(context); } catch (Exception e) { Debug.LogException(e); return e; } return null; } } }