before hook execution error handling; apply attrs argument in addition to instance