mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 01:47:24 +08:00
grpc send error via response instead of grpc error
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package filer_pb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||
)
|
||||
|
||||
@@ -67,3 +70,14 @@ func AfterEntryDeserialization(chunks []*FileChunk) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func CreateEntry(ctx context.Context, client SeaweedFilerClient, request *CreateEntryRequest) error {
|
||||
resp, err := client.CreateEntry(ctx, request)
|
||||
if err == nil && resp.Error != "" {
|
||||
return fmt.Errorf("CreateEntry: %v", resp.Error)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("CreateEntry: %v", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user