BookSleeve.LockMessage.GetErrorMessage C# (CSharp) Method

GetErrorMessage() private static method

private static GetErrorMessage ( AggregateException ex ) : string
ex AggregateException
return string
        private static string GetErrorMessage(AggregateException ex)
        {
            string message = null;
            if(ex != null)
            {
                if (ex.InnerExceptions.Count == 1)
                {
                    message = ex.InnerExceptions[0].Message;
            #if VERBOSE
                        Trace.WriteLine(ex.InnerExceptions[0].StackTrace);
            #endif
                }
                else
                {
                    message = ex.Message;
                }
            }
            return message ?? "Unknown lock failure";
        }