I’m a little baffled. There doesn’t seem to be an easy way to detect cfparam type casting errors.
Before switching to Lucee I would do a check on the error message thrown for the string “Invalid parameter type” in my general error handler and then handle those errors differently to other ones. I’ve found almost all these errors are bot generated.
In Lucee the error message look like this: “Can’t cast String [sd] to a value of type [numeric]” which does not indicate that the casting was attempted in a parameter. It seems it could be triggered by any number of things.
The best I can do is inspect the Tagcontext to try and deduce what the error is about. But that just feels so clunky for something that in my view should not be so difficult.
What would be ideal is for there to be a specific Error Code provided for cfparam validation failures.
If I’m missing something here, let me know.
Lucee Version: 188.8.131.52