Only pass non-nil errors to the catch function.