I am trying to replace my cferror tag(which was in application.cfm) with onError method (in application.cfc which will replace application.cfm).
But I am facing an issue.
The issue is :
For onError, If i tried to display some user friendly message, it is being displayed in the html at the place where the error is occured.
For example, If exception is occured in the footer, then the message is displayed in the footer of the site and everything else(html) on the site is also displayed.
But when i was using cferror tag, If exception is occured, then only that template is being displayed which is specified in cferror tag.
So,
Is there any way to make the onError to work same as cferror tag?
(In sense of displaying user-friendly message)
Thanks.
What you're describing makes sense. The output buffer is already part-filled with a response for the client.
In your onError method in application.cfc, you ought to be able to use <cfcontent reset=true>
to empty the buffer, then you can send whatever response you like.