Question
Handle dbase error with default data (xml) ???
I had MySQL decide to lose data and structure on me (
http://forums.mysql.com/read.php?22,58270,122989#msg-122989
fwiw) and thus had my dev site inoperable.
Consequently I am looking at putting <cfcatch> and <cftry> checks into all my cfc's <cfreturn> (whereby if error then return default array).
I don't know whether to do this by referencing an XML list (of default values) OR by creating an array in the <cfcatch>.
I'm pretty sure it can be done either way but what I guess I'm really asking is what the code would look like (I'm newbie beyond my level of obsession) as I haven't worked with either strategy as yet. Here is code to this point
<cftry> <!--- Return filenames from dbase --->
<cfreturn "#Filenames#"> <!--- If OK return array --->
<cfcatch type="any"> <!--- If ANY error --->
get XML and/or create array here ?????
<cfreturn "#Filenames#" > <!--- Return defaults --->
</cfcatch>
</cftry>
Thanks in advance
Consequently I am looking at putting <cfcatch> and <cftry> checks into all my cfc's <cfreturn> (whereby if error then return default array).
I don't know whether to do this by referencing an XML list (of default values) OR by creating an array in the <cfcatch>.
I'm pretty sure it can be done either way but what I guess I'm really asking is what the code would look like (I'm newbie beyond my level of obsession) as I haven't worked with either strategy as yet. Here is code to this point
<cftry> <!--- Return filenames from dbase --->
<cfreturn "#Filenames#"> <!--- If OK return array --->
<cfcatch type="any"> <!--- If ANY error --->
get XML and/or create array here ?????
<cfreturn "#Filenames#" > <!--- Return defaults --->
</cfcatch>
</cftry>
Thanks in advance
