Skip to content

Commit

Permalink
Add dedicated error message for dynamics
Browse files Browse the repository at this point in the history
  • Loading branch information
schmittjoseph committed Aug 10, 2023
1 parent 78ba1a6 commit 3080efd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public async Task StartCapturingAsync(IList<MethodInfo> methods, CancellationTok
ulong functionId = method.GetFunctionId();
if (functionId == 0)
{
throw new NotSupportedException(method.Name);
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, ParameterCapturingStrings.ErrorMessage_FunctionDoesNotHaveIdFormatString, method.Name));
}

uint[] methodBoxingTokens = BoxingTokens.GetBoxingTokens(method);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void FailedToCapture(Guid requestId, ParameterCapturingEvents.CapturingFa
public void ProbeFault(Guid requestId, InstrumentedMethod faultingMethod)
{
// TODO: Report back this fault on ParameterCapturingEventSource.
_logger?.LogInformation(ParameterCapturingStrings.StoppingParameterCapturingDueToProbeFault, faultingMethod.MethodWithParametersTemplateString);
_logger?.LogWarning(ParameterCapturingStrings.StoppingParameterCapturingDueToProbeFault, faultingMethod.MethodWithParametersTemplateString);

try
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ErrorMessage_FunctionDoesNotHaveIdFormatString" xml:space="preserve">
<value>Method '{0}' is unsupported, it does not have a FunctionID.</value>
</data>
<data name="ErrorMessage_ProbeStateMismatchFormatString" xml:space="preserve">
<value>Mismatch probe state. Expected '{0}', was '{1}'.</value>
</data>
Expand All @@ -142,7 +145,7 @@
<value>Stopped parameter capturing.</value>
</data>
<data name="StoppingParameterCapturingDueToProbeFault" xml:space="preserve">
<value>Parameter capturing encountered an internal exception when processing '{method}', stopping.</value>
<value>Parameter capturing encountered an internal error when processing '{method}', stopping.</value>
</data>
<data name="ThisParameterName" xml:space="preserve">
<value>this</value>
Expand Down

0 comments on commit 3080efd

Please sign in to comment.