Why we are use interceptor function arguments (interceptData)

Hi,
Any one could you explain the use of interceptData in interceptor

I’ve use the below interceptor function but interceptData has dump to null value.

`

public void function preProcess(required event, required interceptData) hint=“INTERCEPTOR: add user object to prc”{

if (findNoCase(‘mb-embed’,cgi.http_host))
event.setLayout(‘widget’);

}

`

And this is the interceptor configuration code

`

interceptors = [
{class=“interceptors.systemInterceptors”}
];

`

How to pass the interceptdata

Could you please explain the this functionality.

Thanks.

Per the docs, the preProcess interceptor doesn’t have any interceptData:

https://coldbox.ortusbooks.com/content/full/interceptors/application_life_cycle.html

So in this case, you don’t need to do anything with it because there is not any extra data related to a preProcess event. InterceptData is used when there is additional information ABOUT the event that you may need. For instance, the onException interception point fires when an error happens, and part of the interrceptData provided to you is the actual error struct.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com