Endjin.Assembly.ChangeDetection.Infrastructure.Tracer.FormatStringSafe C# (CSharp) Method

FormatStringSafe() private static method

private static FormatStringSafe ( string fmt ) : string
fmt string
return string
        private static string FormatStringSafe(string fmt, params object[] args)
        {
            var ret = fmt;
            if (args != null && args.Length > 0)
            {
                try
                {
                    ret = string.Format(fmt, args);
                }
                catch (FormatException)
                {
                    ret = string.Format("Error while formatting #{0}#!", fmt);
                    Debug.Assert(false, "Trace string did cause format Exception: #{0}#", fmt);
                }
            }

            return ret;
        }