I'm writing a custom tag that validates attribute values and if a value
isn't valid it throws an error message consistent with CF's internal
messages, like this:

   <cfset tagName=listGetAt(
                     getFileFromPath(
                        getCurrentTemplatePath()),1,".")>

   <cfset det = "The value of the attribute QUERY is invalid. The " &
                "value must be a reference to a query or the name of " &
                "a query that exists in VARIABLES scope.">

   <cfset e = createObject(
                  "java",
                  "coldfusion.tagext.validation." &
                  "IllegalAttributeValueException")>
   <cfset e.init(tagName, "QUERY", det)>
   <cfthrow object="#e#">


But when the error is thrown CF displays the custom tag code as the location
of the error, like this:


Attribute validation error for tag DISPLAYINCOLUMNS.
The value of the attribute COLUMNS is invalid. The value of the attribute
COLUMNS is invalid. The value must be an integer greater than or equal to
one.

The error occurred in
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\Inventory2004\Input\CustomT
ags\DisplayInColumns.cfm: line 108

106 :                   "coldfusion.tagext.validation." &
107 :                   "IllegalAttributeValueException")>
108 :    <cfset e.init(tagName, "COLUMNS", det)>
109 :    <cfthrow object="#e#">
110 :


Is there a way to get CF to display the error as if it occurred in the
calling page, on the line that called the custom tag?  I tried cfencode, but
that just hides the code.

Thanks,

Sam


----------------------------------------------
Blog:  http://www.rewindlife.com
Chart: http://www.blinex.com/products/charting
----------------------------------------------



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137983
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to