1
0
Fork 0
mirror of https://gitlab.com/sbrl/GalleryShare.git synced 2018-06-12 22:45:16 +00:00

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

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;
}