@@ -228,6 +228,12 @@ type MaskableError interface {
228228 Maskable ()
229229}
230230
231+ // RetryError is an interface for errors which might get resolved through retry
232+ type RetryError interface {
233+ // Retry makes implementer into RetryError type
234+ Retry ()
235+ }
236+
231237// BadRequestError is an interface for errors originated by a bad request
232238type BadRequestError interface {
233239 // BadRequest makes implementer into BadRequestError type
@@ -271,7 +277,7 @@ type InternalError interface {
271277}
272278
273279/******************************
274- * Weel -known Error Formatters
280+ * Well -known Error Formatters
275281 ******************************/
276282
277283// BadRequestErrorf creates an instance of BadRequestError
@@ -314,6 +320,11 @@ func InternalMaskableErrorf(format string, params ...interface{}) error {
314320 return maskInternal (fmt .Sprintf (format , params ... ))
315321}
316322
323+ // RetryErrorf creates an instance of RetryError
324+ func RetryErrorf (format string , params ... interface {}) error {
325+ return retry (fmt .Sprintf (format , params ... ))
326+ }
327+
317328/***********************
318329 * Internal Error Types
319330 ***********************/
@@ -377,3 +388,10 @@ func (mnt maskInternal) Error() string {
377388}
378389func (mnt maskInternal ) Internal () {}
379390func (mnt maskInternal ) Maskable () {}
391+
392+ type retry string
393+
394+ func (r retry ) Error () string {
395+ return string (r )
396+ }
397+ func (r retry ) Retry () {}
0 commit comments