From d3bb658cdaffa6c35b93b8882925b1a86810ac60 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Mon, 17 Jun 2024 15:10:43 +0000 Subject: [PATCH] fix: correct notification error message To create a new notification, the notification_id field must be set to None. Update the error message to clarify this. Fixes #1289 --- google/cloud/storage/notification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/storage/notification.py b/google/cloud/storage/notification.py index 4eb807fa9..9af476d58 100644 --- a/google/cloud/storage/notification.py +++ b/google/cloud/storage/notification.py @@ -255,7 +255,7 @@ def create(self, client=None, timeout=_DEFAULT_TIMEOUT, retry=None): """ if self.notification_id is not None: raise ValueError( - f"Notification already exists w/ id: {self.notification_id}" + f"notification_id already set to {self.notification_id}; must be None to create a Notification." ) client = self._require_client(client)