mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Implements media library scan system infrastructure
This commit is contained in:
1 parent
836a54a7ac
commit
69919f7ca1
29 files changed
+1021
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Utilities;
|
||||
|
||||
/// <summary>
|
||||
/// Task extension method to handle exceptions (avoid littering whole project with try...catch'es).
|
||||
/// </summary>
|
||||
public static class TaskUtilities
|
||||
{
|
||||
/// <summary>
|
||||
/// Extends Task by providing exception handling when a task is invoked on a void method (not awaited).
|
||||
/// </summary>
|
||||
/// <param name="task">The task to be awaited.</param>
|
||||
public static async void FireAndForgetSafeAsync(this Task task)
|
||||
{
|
||||
try
|
||||
{
|
||||
await task;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user