-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphdb): replicate resiliency patterns on edge writer.
- Loading branch information
Showing
4 changed files
with
106 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package graphdb | ||
|
||
import "fmt" | ||
|
||
// errBatchWriter is an error type that wraps an error and indicates whether the | ||
// error is retryable. | ||
type errBatchWriter struct { | ||
err error | ||
retryable bool | ||
} | ||
|
||
func (e errBatchWriter) Error() string { | ||
if e.err == nil { | ||
return fmt.Sprintf("batch writer error (retriable:%v)", e.retryable) | ||
} | ||
|
||
return fmt.Sprintf("batch writer error (retriable:%v): %v", e.retryable, e.err.Error()) | ||
} | ||
|
||
func (e errBatchWriter) Unwrap() error { | ||
return e.err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters