-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtilities.cs
More file actions
37 lines (34 loc) · 1.31 KB
/
Utilities.cs
File metadata and controls
37 lines (34 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*************************************************************************************************
*
* THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
* PARTICULAR PURPOSE.
*
*************************************************************************************************/
using System;
using System.Diagnostics;
namespace Figaro.Web.ApplicationServices
{
/// <summary>
/// Global exception handling policy.
/// </summary>
internal static class ExceptionHandler
{
public static Exception HandleException(Exception ex, string source)
{
//for now, our policy is to simply trace the exception and return null
//anything further requirement can be handled at local level
TraceHelper.Write(source,"[{0}] {1}: {2}\r\nStack Trace:\r\n{3}", source, ex.GetType(), ex.Message,
ex.StackTrace);
return ex;
}
}
internal static class TraceHelper
{
public static void Write(string source, string message, params object[] args)
{
Trace.WriteLine(args == null ? message : string.Format(message, args), source);
}
}
}