Modify code to catch exception thrown by invalid beacon

Last patch broke the build :flushed: