If you get an unhandled exception error, you should actually catch that exception in a try ... catch block.
Or when a function is expected to (re)throw execptions (since it’s not going to handle them internally), it must do so too.
The same goes for functions that are meant to return a return-value, all code paths - including exceptions - must do so.
Since this is not really a Particle specific question, I’d just refer you to some more general answer to that question
BTW, the mere existance of the Particle.variable() in your code does not really prove it’s actually available on the device - e.g. when your code isn’t really the one that’s running on the device.
To actually know whether it exists or not can be checked via console.particle.io/devices or particle list