Test: handling errors