DataPortalException not caught on the client

DataPortalException not caught on the client

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


jeff posted on Tuesday, November 04, 2008

I am trying to catch a DataPortalException on the client but it is only working on my local machine (remoting through localhost). In a web scenario I only get back an Exception and am unable to further inspect it as it only says "the remote server has encountered an error...". The config files look the same on both ends. What could be going on here?

RockfordLhotka replied on Tuesday, November 04, 2008

You'll only get a DataPortalException if the call actually gets into the remote data portal. If there's a pure connectivity problem you'll get whatever exception occurs as a result of that problem.

jeff replied on Tuesday, November 04, 2008

I raise an OrderNumberExistsException in my dataportal code. For some reason though, the error on the client is just an Exception. I'm having trouble diagnosing since it only happens when using my web server.


RockfordLhotka replied on Tuesday, November 04, 2008

Is your OrderNumberExistsException serializable (including the required constructor and get state override)?

 

It is possible that the exception can’t be serialized back over the wire, which would cause a low-level data transport failure.

 

Rocky

 

 

From: jeff [mailto:cslanet@lhotka.net]
Sent: Tuesday, November 04, 2008 12:57 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] DataPortalException not caught on the client

 

I raise an OrderNumberExistsException in my dataportal code. For some reason though, the error on the client is just an Exception. I'm having trouble diagnosing since it only happens when using my web server.




jeff replied on Tuesday, November 04, 2008

    [Serializable]
    public class OrderNumberExistsException : Exception
    {
        public OrderNumberExistsException()
        { }

        protected OrderNumberExistsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        { }
    }


I am using log4net and on the server logs I see that this exception was thrown but it isn't making it back. I am seeing it work using localhost. Probably something easy I'm missing.

JoeFallon1 replied on Tuesday, November 04, 2008

There is a web.config setting about showing exceptions to *remote* users.

When you are local, you see the full exception.

When remote the same exception is hidden with the message you saw.

You need to change your config file.

Joe

 

jeff replied on Friday, November 07, 2008

Change the config to what? I already have:

<customErrors mode="off"></customErrors>

RockfordLhotka replied on Saturday, November 08, 2008

Can you create a small repro of the issue that you could post here?

Also, what data portal channel are you using (WCF, etc)?

JohnB replied on Wednesday, March 10, 2010

Jeff,

What ever became of your issue? I am curious how you solved it.

Thanks,
John

Copyright (c) Marimer LLC