From 99b2020dba85dda01b206014b3747f9426d01683 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 25 Feb 2023 15:44:31 +0100 Subject: [PATCH] Add InvalidExecutionContextException.MemberName --- .../Exceptions/InvalidExecutionContextException.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs b/src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs index b8661343..269e1c65 100644 --- a/src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs +++ b/src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs @@ -3,16 +3,22 @@ using System; namespace ComputeSharp.Exceptions; /// -/// A custom that indicates when an HLSL-only API is called from C# +/// A custom that indicates when an HLSL-only API is called from C#. /// public sealed class InvalidExecutionContextException : InvalidOperationException { /// /// Creates a new instance. /// - /// The name of the caller API. - internal InvalidExecutionContextException(string name) - : base($"The API {name} can only be used from within an HLSL shader.") + /// The member name of the caller API. + internal InvalidExecutionContextException(string memberName) + : base($"The API {memberName} can only be used from within an HLSL shader.") { + MemberName = memberName; } + + /// + /// The name of the member that was incorrectly invoked. + /// + public string MemberName { get; } } \ No newline at end of file