mirror of
https://github.com/sphildreth/roadie
synced 2024-11-26 22:20:21 +00:00
18 lines
No EOL
484 B
C#
18 lines
No EOL
484 B
C#
using Newtonsoft.Json;
|
|
using System;
|
|
|
|
namespace Roadie.Library.Extensions
|
|
{
|
|
public static class ExceptionExt
|
|
{
|
|
public static string Serialize(this Exception input)
|
|
{
|
|
if (input == null) return null;
|
|
var settings = new JsonSerializerSettings
|
|
{
|
|
NullValueHandling = NullValueHandling.Ignore
|
|
};
|
|
return JsonConvert.SerializeObject(input, Formatting.Indented, settings);
|
|
}
|
|
}
|
|
} |