Quick question : does anyone declare a catch variable with "var"?
} catch(any var e) {
w
websolete
01/03/2023, 12:01 AM
no, it's 'special'. matter of fact, i think you'll get an exception if you do. bottom line, you do not need/want to localize a catch var, to the best of my knowledge
👍 1
👍🏼 1
d
Dave Merrill
01/03/2023, 4:09 AM
I always thought of it as an argument to the catch() method, can't be var'd like that, but you can declare its type, which I think has to be Any, like you have (minus the 'var').
g
gavinbaumanis
01/03/2023, 5:35 AM
Thanks very much !
I was just going through the code looking for an unscoped var - for a bug - and there was a cfcatch ... and I just thought : "Am I supposed to Var scope them too?"
They're not - and I never have.... but just wanted to make sure!
Thanks again!