Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CorDebugUtil.cs « Mono.Debugging.Win32 - github.com/mono/debugger-libs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 16203bdda80c8898091d3d39c2b7e7e8094a0b76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
using System.Runtime.InteropServices;
using Mono.Debugging.Client;

namespace Mono.Debugging.Win32
{
	public static class CorDebugUtil
	{
		public static T CallHandlingComExceptions<T> (Func<T> factory, string callName, T defaultValue = default(T))
		{
			try {
				return factory ();
			} catch (COMException e) {
				DebuggerLoggingService.LogMessage ("Exception in {0}: {1}", callName, e.Message);
				return defaultValue;
			}
		}
	}
}