public static ExceptionCode GetFromException(System.Exception ex)
        {
            ExceptionCode code = new ExceptionCode()
            {
                httpStatusCode = DefaultErrorCode,
                errorCode = DefaultErrorCode
            };

            if (ex is CustomException)
                code.httpStatusCode = CustomException.StatusCode;

            if (ex is ExternalException)
                code.errorCode = ((ExternalException)ex).ErrorCode;

            return code;
        }
        public static ExceptionCode GetFromException(System.Exception ex)
        {
            ExceptionCode code = new ExceptionCode()
            {
                httpStatusCode = DefaultErrorCode,
                errorCode      = DefaultErrorCode
            };

            if (ex is CustomException)
            {
                code.httpStatusCode = CustomException.StatusCode;
            }

            if (ex is ExternalException)
            {
                code.errorCode = ((ExternalException)ex).ErrorCode;
            }

            return(code);
        }