Skip to content

Commit

Permalink
Use JniEnvironment.Runtime.OnUserUnhandledException.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpobst committed Nov 21, 2024
1 parent 98beeaa commit 2aafd3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/Java.Interop/Java.Interop/JniRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ public virtual bool ExceptionShouldTransitionToJni (Exception e)

partial class JniRuntime {

public virtual void OnUserUnhandledException (ref JniTransition transition, Exception e)

Check failure on line 440 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop (Mac - .NET)

src/Java.Interop/Java.Interop/JniRuntime.cs#L440

src/Java.Interop/Java.Interop/JniRuntime.cs(440,23): Error RS0016: Symbol 'OnUserUnhandledException' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)

Check failure on line 440 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop (Mac - .NET)

src/Java.Interop/Java.Interop/JniRuntime.cs#L440

src/Java.Interop/Java.Interop/JniRuntime.cs(440,23): Error RS0016: Symbol 'OnUserUnhandledException' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)

Check failure on line 440 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop

src/Java.Interop/Java.Interop/JniRuntime.cs#L440

src/Java.Interop/Java.Interop/JniRuntime.cs(440,23): Error RS0016: Symbol 'OnUserUnhandledException' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)

Check failure on line 440 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop

src/Java.Interop/Java.Interop/JniRuntime.cs#L440

src/Java.Interop/Java.Interop/JniRuntime.cs(440,23): Error RS0016: Symbol 'OnUserUnhandledException' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)
{
transition.SetPendingException (e);
Debugger.BreakForUserUnhandledException (e);

Check failure on line 443 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop (Mac - .NET)

src/Java.Interop/Java.Interop/JniRuntime.cs#L443

src/Java.Interop/Java.Interop/JniRuntime.cs(443,13): Error CS0117: 'Debugger' does not contain a definition for 'BreakForUserUnhandledException'

Check failure on line 443 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop (Mac - .NET)

src/Java.Interop/Java.Interop/JniRuntime.cs#L443

src/Java.Interop/Java.Interop/JniRuntime.cs(443,13): Error CS0117: 'Debugger' does not contain a definition for 'BreakForUserUnhandledException'

Check failure on line 443 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop

src/Java.Interop/Java.Interop/JniRuntime.cs#L443

src/Java.Interop/Java.Interop/JniRuntime.cs(443,13): Error CS0117: 'Debugger' does not contain a definition for 'BreakForUserUnhandledException'

Check failure on line 443 in src/Java.Interop/Java.Interop/JniRuntime.cs

View check run for this annotation

Azure Pipelines / Java.Interop

src/Java.Interop/Java.Interop/JniRuntime.cs#L443

src/Java.Interop/Java.Interop/JniRuntime.cs(443,13): Error CS0117: 'Debugger' does not contain a definition for 'BreakForUserUnhandledException'
}

public virtual void RaisePendingException (Exception pendingException)
{
JniEnvironment.Exceptions.Throw (pendingException);
Expand Down
3 changes: 1 addition & 2 deletions tools/generator/SourceWriters/MethodCallback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ protected override void WriteBody (CodeWriter writer)

writer.WriteLine ("} catch (global::System.Exception __e) {");
writer.Indent ();
writer.WriteLine ("__envp.SetPendingException (__e);");
writer.WriteLine ("global::System.Diagnostics.Debugger.BreakForUserUnhandledException (__e);");
writer.WriteLine ("JniEnvironment.Runtime.OnUserUnhandledException (ref __envp, __e);");

if (!method.IsVoid)
writer.WriteLine ("return default;");
Expand Down

0 comments on commit 2aafd3f

Please sign in to comment.