mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 06:13:40 +01:00
feat: show throwing plugin in unhandled managed exceptions
This commit is contained in:
parent
063a9408e1
commit
1096a49dd6
2 changed files with 32 additions and 4 deletions
|
|
@ -1300,14 +1300,14 @@ Thanks and have fun!";
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the plugin that called this method by walking the stack,
|
||||
/// Get the plugin that called this method by walking the provided stack trace,
|
||||
/// or null, if it cannot be determined.
|
||||
/// At the time, this is naive and shouldn't be used for security-critical checks.
|
||||
/// </summary>
|
||||
/// <param name="trace">The trace to walk.</param>
|
||||
/// <returns>The calling plugin, or null.</returns>
|
||||
public LocalPlugin? FindCallingPlugin()
|
||||
public LocalPlugin? FindCallingPlugin(StackTrace trace)
|
||||
{
|
||||
var trace = new StackTrace();
|
||||
foreach (var frame in trace.GetFrames())
|
||||
{
|
||||
var declaringType = frame.GetMethod()?.DeclaringType;
|
||||
|
|
@ -1328,6 +1328,14 @@ Thanks and have fun!";
|
|||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the plugin that called this method by walking the stack,
|
||||
/// or null, if it cannot be determined.
|
||||
/// At the time, this is naive and shouldn't be used for security-critical checks.
|
||||
/// </summary>
|
||||
/// <returns>The calling plugin, or null.</returns>
|
||||
public LocalPlugin? FindCallingPlugin() => this.FindCallingPlugin(new StackTrace());
|
||||
|
||||
private void DetectAvailablePluginUpdates()
|
||||
{
|
||||
var updatablePlugins = new List<AvailablePluginUpdate>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue