Global Exception handling

  • Thread starter Thread starter Tod Johnson
  • Start date Start date
T

Tod Johnson

Hi all,

Is it possible to catch all unhandled exceptions in the CF application?

Thank you,
Tod
 
You should be able to catch all managed exceptions. Native exceptions
should be extremely rare though possible.

For more info got to http://msdn.microsoft.com/mobility
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Date: Fri, 06 Aug 2004 19:30:33 +0300
| From: Tod Johnson <[email protected]>
| User-Agent: Mozilla Thunderbird 0.6b (Windows/20040427)
| X-Accept-Language: en-us, en
| MIME-Version: 1.0
| Subject: Global Exception handling
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: mpe-9-52.mpe.lv 83.241.9.52
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:58855
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi all,
|
| Is it possible to catch all unhandled exceptions in the CF application?
|
| Thank you,
| Tod
|
 
Fernando said:
You should be able to catch all managed exceptions. Native exceptions
should be extremely rare though possible.
but is there something like:

AppDomain.CurrentDomain.UnhandledException or
Application.ThreadException? Or maybe I can to workaround it?

Thank you,
Tod
 
What error are you seeing?
If you use Exception you will be able to catch all managed exceptions that
are thrown.

try {
}
catch(Exception e)
{
}

For more info go to:
Mobility: http://msdn.microsoft.com/mobility
NETCF:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Date: Sat, 07 Aug 2004 10:51:11 +0300
| From: Tod Johnson <[email protected]>
| User-Agent: Mozilla Thunderbird 0.6b (Windows/20040427)
| X-Accept-Language: en-us, en
| MIME-Version: 1.0
| Subject: Re: Global Exception handling
| References: <[email protected]>
<[email protected]>
| In-Reply-To: <[email protected]>
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: mpe-9-52.mpe.lv 83.241.9.52
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:58877
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Fernando Fanton [MSFT] wrote:
| > You should be able to catch all managed exceptions. Native exceptions
| > should be extremely rare though possible.
| but is there something like:
|
| AppDomain.CurrentDomain.UnhandledException or
| Application.ThreadException? Or maybe I can to workaround it?
|
| Thank you,
| Tod
|
 
Thank you Fernando for answer.

I'd like to catch exceptions in one place in the application. You see,
the try...catch solves this problem partly. Every time when I'd like to
catch exception I have to enclose dangerous piece of code into try ...
catch. It's not convenient way... :( That's why I asked about:
Application.ThreadException in CF.NET applications.
 
I see, we don't have Application.ThreadException event on V1. We are
evaluating whether we will support something like this on V2 but no
decition has been made yet.

For more info go to:
Mobility: http://msdn.microsoft.com/mobility
NETCF:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Date: Wed, 11 Aug 2004 15:15:28 +0300
| From: Tod Johnson <[email protected]>
| User-Agent: Mozilla Thunderbird 0.6b (Windows/20040427)
| X-Accept-Language: en-us, en
| MIME-Version: 1.0
| Subject: Re: Global Exception handling
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| In-Reply-To: <[email protected]>
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: mpe-9-52.mpe.lv 83.241.9.52
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:59164
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Thank you Fernando for answer.
|
| I'd like to catch exceptions in one place in the application. You see,
| the try...catch solves this problem partly. Every time when I'd like to
| catch exception I have to enclose dangerous piece of code into try ...
| catch. It's not convenient way... :( That's why I asked about:
| Application.ThreadException in CF.NET applications.
|
| Fernando Fanton [MSFT] wrote:
| > What error are you seeing?
| > If you use Exception you will be able to catch all managed exceptions
that
| > are thrown.
| >
| > try {
| > }
| > catch(Exception e)
| > {
| > }
| >
|
 
Back
Top