ExeptionHandling und Weiter.....?

Hi Leute!

Zur Rekursion:
[post=993154]Re: Folder copy - Post[/post]

Die Exeptions die auftreten könnten kannst so behandeln:
C#:
class ErrorHandler
{
	Exception _Exception;

	/// <summary>
	/// Im Konstukor wird die Exception gespeichert und anschließend behandelt.
	/// </summary>
	/// <param name="ex"></param>
	public ErrorHandler( Exception ex ) {
		_Exception = ex;
		HandleException();
	}


	void HandleException() {
		if ( _Exception is SoapException )
			UserDialog.Show_SOAPexception( _Exception );
		else if ( _Exception is WebException )
			UserDialog.Show_SysNetWebException( _Exception );
		else if ( _Exception is SocketException )
			UserDialog.Show_SysNetWebException( _Exception );
		else if ( _Exception is ArgumentOutOfRangeException ) 
			UserDialog.Show_UnusualException( _Exception );
		else if ( _Exception.GetType() != typeof (Exception) )
			UserDialog.Show_UnusualException( _Exception );
		else UserDialog.Show_Exception( _Exception );
	}
}

So ich muss wieder... Macht's gut.

MfG,
cosmo
 

Neue Beiträge

Zurück