Silverlight Csla.Utilities.ToErrorInfo does not set ExceptionTypeName

Silverlight Csla.Utilities.ToErrorInfo does not set ExceptionTypeName

Old forum URL: forums.lhotka.net/forums/t/11703.aspx


Peran posted on Wednesday, November 14, 2012

I have been doing some testing with a Silverlight app being temporarily disconnected from the internet.

I was having difficulty identifying the type of exception because DataPortalException.ErrorInfo.ExceptionTypeName was being return as null when thrown on the client.

This would be fixed in the Csla.Silverlight project by modifying Csla.Utilities.ToErrorInfo to include initialization of ExceptionTypeName.

 

        public static WcfErrorInfo ToErrorInfo(this Exception ex)
        {
            WcfErrorInfo info = null;
            if (ex != null)
            {
                info = new WcfErrorInfo
                {
                    ExceptionTypeName = ex.GetType().FullName,
                    Message = ex.Message,
                    StackTrace = ex.StackTrace,
                    InnerError = ex.InnerException.ToErrorInfo()
                };
            }
 
            return info;
        }

Rocky, let me know if you want svn updated.
Regards
Peran

RockfordLhotka replied on Wednesday, November 14, 2012

Yes, good catch.

Copyright (c) Marimer LLC