![MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Скачать руководство пользователя страница 128](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-developing-web/coldfusion-4-5-developing-web_develop-manual_3286369128.webp)
102
Developing Web Applications with ColdFusion
<UL>
<LI><B>Message:</B> #CFCATCH.message#
<LI><B>Detail:</B> #CFCATCH.Detail#
</UL>
</CFOUTPUT>
4
</CFCATCH>
4
</CFTRY>
</BODY>
</HTML>
Custom Exception Types
The TYPE attribute allows a CFTHROW tag to throw an exception of a specific type,
which can be caught by a CFCATCH tag that has a matching TYPE attribute.
A CFTHROW tag without a TYPE attribute will throw a TYPE="Application" exception.
Naming conventions
A naming convention for custom exception types follows a convention that is similar
to Java class naming conventions: domain name in reverse order, followed by project
identifiers, as in this example:
<CFTHROW
TYPE="COM.Allaire.ProjectName"
ERRORCODE="Dodge14B">
The predefined exception types, except for TYPE="APPLICATION" are reserved; for
example, <CFTHROW TYPE="Database"> will be rejected.
A CFCATCH tag can specify a custom type as well as one of the predefined types. For
example, to catch the exception thrown above, you would use this syntax:
<CFCATCH TYPE="COM.Allaire.ProjectName">
ColdFusion uses the catch type as a pattern to find a catch handler. For example,
<CFTHROW TYPE="MyApp.BusinessRuleException.InvalidAccount">
would try to find:
<CFCATCH TYPE="MyApp.BusinessRuleException.InvalidAccount">
<CFCATCH TYPE="MyApp.BusinessRuleException">
<CFCATCH TYPE="MyApp">
The type comparison is case-insensitive. To match types exactly, rather than
performing pattern matching, use the CFSETTING attribute
CATCHEXCEPTIONSBYPATTERN=No.
Содержание COLDFUSION 4.5-DEVELOPING WEB
Страница 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Страница 14: ...xiv Developing Web Applications with ColdFusion...
Страница 26: ...xxvi Developing Web Applications with ColdFusion...
Страница 34: ...8 Developing Web Applications with ColdFusion...
Страница 70: ...44 Developing Web Applications with ColdFusion...
Страница 84: ...58 Developing Web Applications with ColdFusion...
Страница 114: ...88 Developing Web Applications with ColdFusion...
Страница 148: ...122 Developing Web Applications with ColdFusion...
Страница 174: ...148 Developing Web Applications with ColdFusion...
Страница 208: ...182 Developing Web Applications with ColdFusion...
Страница 244: ...218 Developing Web Applications with ColdFusion...
Страница 274: ...248 Developing Web Applications with ColdFusion...
Страница 288: ...262 Developing Web Applications with ColdFusion...
Страница 300: ...274 Developing Web Applications with ColdFusion...
Страница 350: ...324 Developing Web Applications with ColdFusion...
Страница 362: ...336 Developing Web Applications with ColdFusion...