|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
http 500 skipping out of catch block |
« View previous topic :: View next topic » |
Author |
Message
|
futuremqguruihope |
Posted: Mon May 07, 2007 8:53 am Post subject: http 500 skipping out of catch block |
|
|
Novice
Joined: 18 Apr 2007 Posts: 10
|
Hi all I'm having the following issue in my VS 2003, .net framework 1.1, vb.net wsmq application and haven't been able to find a similar one addressed on the forum:
When I try to instantiate a queue manager and it fails, the exception is caught in the following block -
1. Catch ex As Exception
2. Dim mqexception As MQException
3. mqexception = CType(ex, MQException)
4. strResponse = ex.Message & " " & IIf(ex.InnerException Is Nothing, "", ex.InnerException.Message) & " " & mqexception.ReasonCode
5. End Try
Ideally, I would execute all the above lines and get a nice strResponse string. However, when I step through, lines 1 and 2 execute, and then I jumnp out of debugger and focus goes to the web page, which has been rerouted to an http 500 error page.
Does anyone know why lines 3-5 are skipped?
Thanks. |
|
Back to top |
|
 |
futuremqguruihope |
Posted: Mon May 07, 2007 9:04 am Post subject: http 500 skipping out of catch block |
|
|
Novice
Joined: 18 Apr 2007 Posts: 10
|
So I've discovered that the cast to mqexception is an invalid one, so that's throwing an exception.
So how do I access the mqexception.reasoncode? I can't catch these exceptions as mqexception for some reason. That's why after catching it as an exception, I'm casting it to an mqexception...
Any advice? |
|
Back to top |
|
 |
futuremqguruihope |
Posted: Mon May 07, 2007 9:54 am Post subject: http 500 skipping out of catch block |
|
|
Novice
Joined: 18 Apr 2007 Posts: 10
|
Got it! It appears I needed to do the cast as follows:
CType(ex, IBM.WMQ.MQException)
I'm not entirely sure why, though, since "Dim mqexception As MQException" had no problem, and thus MQException was in scope.
Oh well, hope this helps somebody else! |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|