you can define and throw your own custom errors using <cferror>/onError() and <cfthrow>.
enclose your insert query in cftry/cfcatch block, and inside the cfcatch block throw your own error if cfcatch.type eq "Database" and cfcatch.queryError exists and starts with "Duplicate entry" words.
<cftry>
<cfquery ...>
your insert query here
</cfquery>
<cfcatch type="Database">
<cfif cfcatch.type eq "Database" AND structkeyexists(cfcatch, 'queryError') AND refindnocase('^Duplicate entry', cfcatch.queryError)>
<cfthrow type="duplicateEntry" message="Error! Trying to Insert same Record Twice, not allowed!" detail="some detailed info here">
</cfif>
</cfcatch>
</cftry>
now using <cferror> tag in your Application.cfm or onError() method in your Application.cfc, you can catch your custom duplicateEntry error type and do whatever you want with it...
Azadi