internal static void Try(InternalExceptionCode rethrowCode, Action action) => Try(() => Rethrow(rethrowCode, action));
internal static T Try <T>(InternalExceptionCode rethrowCode, Func <T> action) => Try(() => Rethrow(rethrowCode, action));
internal static void Rethrow(InternalExceptionCode errorCode, Action action) => Rethrow(errorCode, () => { action(); return(0); });
internal static T Rethrow <T>(InternalExceptionCode errorCode, Func <T> action) { try { return(action()); } catch (Exception exception) { throw new InternalException(errorCode, exception); } }
internal void Throw(InternalExceptionCode errorCode) => this.Run(() => throw new InternalException(errorCode));