Catching error in jos_controller