Now throws specific exceptions on error.