Carrotware.CMS.DBUpdater.DatabaseUpdate.SystemNeedsChecking C# (CSharp) Method

SystemNeedsChecking() public static method

public static SystemNeedsChecking ( Exception ex ) : bool
ex System.Exception
return bool
        public static bool SystemNeedsChecking(Exception ex)
        {
            //assumption is database is probably empty / needs updating, so trigger the under construction view

            if (ex is SqlException && ex != null) {
                string msg = ex.Message.ToLower();
                if (ex.InnerException != null) {
                    msg += "\r\n" + ex.InnerException.Message.ToLower();
                }
                if (msg.Contains("the server was not found")) {
                    return false;
                }

                if (msg.Contains("invalid object name")
                    //|| msg.Contains("no process is on the other end of the pipe")
                    || msg.Contains("invalid column name")
                    || msg.Contains("could not find stored procedure")
                    || msg.Contains("not found")) {
                    return true;
                }
            }

            return false;
        }