hook error catching test