Handle error condition where service constant not defined

Surrounded the code with a begin / rescue block