|
@@ -228,6 +228,12 @@ type MaskableError interface {
|
|
Maskable()
|
|
Maskable()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// RetryError is an interface for errors which might get resolved through retry
|
|
|
|
+type RetryError interface {
|
|
|
|
+ // Retry makes implementer into RetryError type
|
|
|
|
+ Retry()
|
|
|
|
+}
|
|
|
|
+
|
|
// BadRequestError is an interface for errors originated by a bad request
|
|
// BadRequestError is an interface for errors originated by a bad request
|
|
type BadRequestError interface {
|
|
type BadRequestError interface {
|
|
// BadRequest makes implementer into BadRequestError type
|
|
// BadRequest makes implementer into BadRequestError type
|
|
@@ -271,7 +277,7 @@ type InternalError interface {
|
|
}
|
|
}
|
|
|
|
|
|
/******************************
|
|
/******************************
|
|
- * Weel-known Error Formatters
|
|
|
|
|
|
+ * Well-known Error Formatters
|
|
******************************/
|
|
******************************/
|
|
|
|
|
|
// BadRequestErrorf creates an instance of BadRequestError
|
|
// BadRequestErrorf creates an instance of BadRequestError
|
|
@@ -314,6 +320,11 @@ func InternalMaskableErrorf(format string, params ...interface{}) error {
|
|
return maskInternal(fmt.Sprintf(format, params...))
|
|
return maskInternal(fmt.Sprintf(format, params...))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// RetryErrorf creates an instance of RetryError
|
|
|
|
+func RetryErrorf(format string, params ...interface{}) error {
|
|
|
|
+ return retry(fmt.Sprintf(format, params...))
|
|
|
|
+}
|
|
|
|
+
|
|
/***********************
|
|
/***********************
|
|
* Internal Error Types
|
|
* Internal Error Types
|
|
***********************/
|
|
***********************/
|
|
@@ -377,3 +388,10 @@ func (mnt maskInternal) Error() string {
|
|
}
|
|
}
|
|
func (mnt maskInternal) Internal() {}
|
|
func (mnt maskInternal) Internal() {}
|
|
func (mnt maskInternal) Maskable() {}
|
|
func (mnt maskInternal) Maskable() {}
|
|
|
|
+
|
|
|
|
+type retry string
|
|
|
|
+
|
|
|
|
+func (r retry) Error() string {
|
|
|
|
+ return string(r)
|
|
|
|
+}
|
|
|
|
+func (r retry) Retry() {}
|