Added Exception detection and re-throwing to SleepGateway