Throw error messages properly