[cfaussie] Re: return error code to browser
In a dim memory, i have a feeling that cfabort stops CF from doing anything rational... see if you can code it a little more like cfif ErrorOfSomeSort cfheader statuscode=400 statustext=Bad Request / cfelse ... do cool stuff here /cfif then grab the liveheaders extension for firefox and watch your header get sent back to the browser... L. On 3/14/07, AJ Mercer [EMAIL PROTECTED] wrote: I would like to return an error code to the browser that will be trapped by JavaScript. This is what I have at the moment - but doesn't seem to be doing what I am after cfif ErrorOfSomeSort cfheader statuscode=400 statustext=Bad Request / cfabort / /cfif Any suggestions would be greatly appreciated. -- Lucas http://www.thebitbucket.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: return error code to browser
If you want javascript to raise an error, you'll have to cfif errorHappened cfoutput script language=javascript alert(Oh noes); /script /cfoutput /cfif in addidtion to maybe sending a http error code. Http error code with tell the browser something went wrong, and the body of the page will make it look nice for the user. Take this further, if(errorHappened){ redirectToErrorPage(reason) } is more what I would do. AJ Mercer wrote: I would like to return an error code to the browser that will be trapped by JavaScript. This is what I have at the moment - but doesn't seem to be doing what I am after cfif ErrorOfSomeSort cfheader statuscode=400 statustext=Bad Request / cfabort / /cfif Any suggestions would be greatly appreciated. -- Haikal Saadh Applications Programmer ICT Resources, TALSS QUT Kelvin Grove --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: return error code to browser
The error is raised in ColdFusion and returned to the browser and trapped Actually, it is a flash object that is making the call to ColdFusion . So I can see what is happening with live headers in firefox :-( On 3/14/07, Haikal Saadh [EMAIL PROTECTED] wrote: If you want javascript to raise an error, you'll have to cfif errorHappened cfoutput script language=javascript alert(Oh noes); /script /cfoutput /cfif in addidtion to maybe sending a http error code. Http error code with tell the browser something went wrong, and the body of the page will make it look nice for the user. Take this further, if(errorHappened){ redirectToErrorPage(reason) } is more what I would do. AJ Mercer wrote: I would like to return an error code to the browser that will be trapped by JavaScript. This is what I have at the moment - but doesn't seem to be doing what I am after cfif ErrorOfSomeSort cfheader statuscode=400 statustext=Bad Request / cfabort / /cfif Any suggestions would be greatly appreciated. -- Haikal Saadh Applications Programmer ICT Resources, TALSS QUT Kelvin Grove -- If you are not living on the edge, You are taking up too much space. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: return error code to browser
The flash applet recognizes this one cfheader statuscode=404 statustext=Not Found / I think I can live with that for now. On 3/14/07, AJ Mercer [EMAIL PROTECTED] wrote: The error is raised in ColdFusion and returned to the browser and trapped Actually, it is a flash object that is making the call to ColdFusion . So I can see what is happening with live headers in firefox :-( On 3/14/07, Haikal Saadh [EMAIL PROTECTED] wrote: If you want javascript to raise an error, you'll have to cfif errorHappened cfoutput script language=javascript alert(Oh noes); /script /cfoutput /cfif in addidtion to maybe sending a http error code. Http error code with tell the browser something went wrong, and the body of the page will make it look nice for the user. Take this further, if(errorHappened){ redirectToErrorPage(reason) } is more what I would do. AJ Mercer wrote: I would like to return an error code to the browser that will be trapped by JavaScript. This is what I have at the moment - but doesn't seem to be doing what I am after cfif ErrorOfSomeSort cfheader statuscode=400 statustext=Bad Request / cfabort / /cfif Any suggestions would be greatly appreciated. -- Haikal Saadh Applications Programmer ICT Resources, TALSS QUT Kelvin Grove -- If you are not living on the edge, You are taking up too much space. -- If you are not living on the edge, You are taking up too much space. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---