Handle errors on $broadcast and $emit