Change exceptions type in register_resource