PalacePal/Pal.Client/DependencyInjection/DebugState.cs

15 lines
298 B
C#
Raw Normal View History

2023-02-15 22:17:19 +00:00
using System;
2023-03-30 20:01:43 +00:00
namespace Pal.Client.DependencyInjection;
internal sealed class DebugState
2023-02-15 22:17:19 +00:00
{
2023-03-30 20:01:43 +00:00
public string? DebugMessage { get; set; }
2023-02-15 22:17:19 +00:00
2023-03-30 20:01:43 +00:00
public void SetFromException(Exception e)
=> DebugMessage = $"{DateTime.Now}\n{e}";
2023-02-15 22:17:19 +00:00
2023-03-30 20:01:43 +00:00
public void Reset()
=> DebugMessage = null;
2023-02-15 22:17:19 +00:00
}