ColdFusion: get arguments to a function that throws an error in the onError method of Application.cfc

I am extending the errormanagement function, which resets several areas of variables and emails them to me. I am using the onError method in Application.cfc for this case.

<CFDUMP var="#arguments.exception#" label="Error"> <CFDUMP var="#Application#" label="APPLICATION-Scope" /> <CFDUMP var="#form#" label="FORM-Scope"> <CFDUMP var="#url#" label="URL-Scope"> <CFDUMP var="#CGI#" label="CGI-Scope" /> <CFDUMP var="#session#" label="SESSION-Scope" /> <CFDUMP var="#variables#" label="VARIABLES-Scope" /> 

onError has an exception as an argument, which I dump first in this example .... but how do I get the arguments of the function in which the error occurred? For example, if I call UDF in my Application.cfc onRequest method, for example <CFSET giveMeMyScripts("javascript-file-1","javascript-file-2") /> Can I get javascript-file-1 and javascript-file-2 ? Kind of super arguments?

Thanks for any thoughts on this.

+4
source share
2 answers

I am not 100% sure, but you can just discard the arguments. It may depend on how many functions you are deep.

Generally, if you delete all areas and the exception, you have all the bits of information you need.

We do almost what you do and unload every area in application.cfc

0
source

Not sure if you can do this without setting a specific error trap in this function. But if you are just debugging and need to get past the error, temporarily copy the arguments to the request area, and then delete the request area.

0
source

Source: https://habr.com/ru/post/1403455/


All Articles