public static void Operation(bool condition, string unformattedMessage, params object[] args) { if (!condition) { throw new InvalidOperationException(PrivateErrorHelpers.Format(unformattedMessage, args)); } }
/// <summary> /// Helper method that formats string arguments. /// </summary> private static string Format(string format, params object[] arguments) { return(PrivateErrorHelpers.Format(format, arguments)); }
public static Exception FailOperation(string message, params object[] args) { throw new InvalidOperationException(PrivateErrorHelpers.Format(message, args)); }