From fc8847b8c09479a346c2d9561f050d4e32bbc0c3 Mon Sep 17 00:00:00 2001 From: Jun <77525145+junaire@users.noreply.github.com> Date: Mon, 5 Jul 2021 21:53:12 +0800 Subject: [PATCH] Implement GSP-127: Add ServiceInternal and RequestThrottled Errors (#138) --- docs/go-storage/internal/handling-errors.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/go-storage/internal/handling-errors.md b/docs/go-storage/internal/handling-errors.md index b4973ffb..88736328 100644 --- a/docs/go-storage/internal/handling-errors.md +++ b/docs/go-storage/internal/handling-errors.md @@ -58,6 +58,16 @@ if err != nil { n, err := store.Read(path, &buf) if err != nil { + if errors.Is(err, services.ErrServiceInternal) { + // handle ErrServiceInternal + // (global error) + return + } + if errors.Is(err, services.ErrRequestThrottled) { + // handle ErrRequestThrottled + // (global error) + return + } if errors.Is(err, services.ErrObjectNotExist) { // handle ErrObjectNotExist // (global error) @@ -103,6 +113,8 @@ Error Code|Fine-grained Error Type -----|----- `ErrObjectNotExist`|N/A `ErrPermissionDenied`|N/A +`ErrServiceInternal` |N/A +`ErrRequestThrottled` |N/A ## Top-level Errors