From 1db516c53c0f404935a7eed35daddcab9620a8a2 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Sat, 1 May 2021 06:38:33 -0700 Subject: [PATCH] Add a list of canonical errors in base package --- internal/base/base.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/base/base.go b/internal/base/base.go index db9c145..5384e76 100644 --- a/internal/base/base.go +++ b/internal/base/base.go @@ -7,6 +7,7 @@ package base import ( "context" + "errors" "fmt" "sync" "time" @@ -589,3 +590,10 @@ type Broker interface { PublishCancelation(id string) error Close() error } + +// List of canonical errors. +var ( + ErrNotFound = errors.New("not found") + ErrFailedPrecondition = errors.New("failed precondition") + ErrInternal = errors.New("internal error") +)