From f32388445484926bcb8ca17e61e24e22bf086220 Mon Sep 17 00:00:00 2001 From: Guillaume Charest <1690085+gcharest@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:02:15 +0000 Subject: [PATCH] fix: add missing error handler --- app/integrations/google_workspace/google_docs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/integrations/google_workspace/google_docs.py b/app/integrations/google_workspace/google_docs.py index 7fc2d0be..ceb0792e 100644 --- a/app/integrations/google_workspace/google_docs.py +++ b/app/integrations/google_workspace/google_docs.py @@ -12,9 +12,10 @@ get(document_id: str) -> dict: Gets a document from Google Docs and returns the document resource. """ -from integrations.google_workspace.google_service import get_google_service +from integrations.google_workspace.google_service import (get_google_service, handle_google_api_errors) +@handle_google_api_errors def create(title: str) -> str: """Creates a new document in Google Docs. @@ -30,6 +31,7 @@ def create(title: str) -> str: return result["documentId"] +@handle_google_api_errors def batch_update(document_id: str, requests: list) -> None: """Applies a list of updates to a document in Google Docs. @@ -48,6 +50,7 @@ def batch_update(document_id: str, requests: list) -> None: ).execute() +@handle_google_api_errors def get(document_id: str) -> dict: """Gets a document from Google Docs.