MCPcopy Create free account
hub / github.com/google/go-cloud / wrapError

Function wrapError

blob/blob.go:1606–1622  ·  view source on GitHub ↗
(b driver.Bucket, err error, key string)

Source from the content-addressed store, hash-verified

1604}
1605
1606func wrapError(b driver.Bucket, err error, key string) error {
1607 if err == nil {
1608 return nil
1609 }
1610 if gcerr.DoNotWrap(err) {
1611 return err
1612 }
1613 msg := "blob"
1614 if key != "" {
1615 msg += fmt.Sprintf(" (key %q)", key)
1616 }
1617 code := gcerrors.Code(err)
1618 if code == gcerrors.Unknown {
1619 code = b.ErrorCode(err)
1620 }
1621 return gcerr.New(code, err, 2, msg)
1622}
1623
1624var errClosed = gcerr.Newf(gcerr.FailedPrecondition, nil, "blob: Bucket has been closed")
1625

Callers 14

ReadMethod · 0.70
CloseMethod · 0.70
CloseMethod · 0.70
openMethod · 0.70
writeMethod · 0.70
NextMethod · 0.70
ListPageMethod · 0.70
AttributesMethod · 0.70
newRangeReaderMethod · 0.70
NewWriterMethod · 0.70
CopyMethod · 0.70
DeleteMethod · 0.70

Calls 4

DoNotWrapFunction · 0.92
CodeFunction · 0.92
NewFunction · 0.92
ErrorCodeMethod · 0.65

Tested by

no test coverage detected