When I raise an exception from my Data Reference, I don't want to see the "System.ApplicationException" and the stack trace in PI System Explorer.
Anybody knows how to do this?
Joel...can you confirm as I am not sure what you are asking. You DO want to see the stack trace or you DON'T & want to provide your own custom error message?
I want to provide my own message. I do NOT want to see any stack trace or source.
Normally, only the "Message" of any exception thrown is shown. This would not include the stack trace. Perhaps you are throwing an exception in an unexpected method of the data reference, like the constructor (as opposed to a more typical "GetValue" scenario)?
Are you building AF 1.3 plugins and using the compatibility layer, or are you using AF 2.0 directly?
Yes I am using the 1.3 plugins with the compatibility layer. From AFExplorer or PI System Explorer, I see the same thing. I throw an ApplicationException from GetValue (Throw New ApplicationException("my message") and I am getting a prefix "System.ApplicationException:" and a suffix "at OSISoft....GetValue..."
Arent' you getting the same thing when Exceptions are raised from your code?
Sorry for wasting your time on this . I found why. I was throwing my exception in a nested try catch.
I now throw it outside and it works fine
No problem, glad you found it. But you had me worried there for a bit.
Retrieving data ...