Jon Jagger
jon@jaggersoft.com
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 15 Statementsprevious at this levelnext at this level 15.9 Jump statementsprevious at this levelnext at this level 15.9.5 The throw statement Paragraph 11 The throw statement throws an exception. throw-statement : throw expressionopt ; Paragraph 21 A throw statement with an expression throws the value produced by evaluating the expression. 2 The expression must denote a value of the class type System.Exception or of a class type that derives from System.Exception. 3 If evaluation of the expression produces null, a System.NullReferenceException is thrown instead. Paragraph 31 A throw statement with no expression can be used only in a catch block, in which case, that statement re-throws the exception that is currently being handled by that catch block. Paragraph 41 Because a throw statement unconditionally transfers control elsewhere, the end point of a throw statement is never reachable. Paragraph 51 When an exception is thrown, control is transferred to the first catch clause in an enclosing try statement that can handle the exception. 2 The process that takes place from the point of the exception being thrown to the point of transferring control to a suitable exception handler is known as exception propagation. 3 Propagation of an exception consists of repeatedly evaluating the following steps until a catch clause that matches the exception is found. 4 In this description, the throw point is initially the location at which the exception is thrown.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS