1
0
Fork 0

Unwrap async AggregateExceptions and throw each error in turn.

This commit is contained in:
Starbeamrainbowlabs 2016-07-18 15:46:26 +01:00
parent 0d5dcec352
commit 0926851f05
1 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
namespace GalleryShare
{
@ -38,7 +39,22 @@ namespace GalleryShare
}
GalleryServer gserver = new GalleryServer(directory, port);
gserver.StartSync();
try
{
gserver.StartSync();
}
catch(AggregateException agError)
{
agError.Handle((error) => {
ExceptionDispatchInfo.Capture(error).Throw();
throw error;
});
}
catch
{
Console.Error.WriteLine("Something went very wrong O.o");
throw;
}
return 255;
}