forked from TrueCloudLab/frostfs-node
[#1558] morph/client: Remove "could not"/"can't"/"failed to" from error messages
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
91d9dc2676
commit
7151c71d51
19 changed files with 55 additions and 55 deletions
|
@ -60,7 +60,7 @@ func (c *Client) Get(cid []byte) (*containercore.Container, error) {
|
|||
|
||||
arr, err := client.ArrayFromStackItem(res[0])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get item array of container (%s): %w", getMethod, err)
|
||||
return nil, fmt.Errorf("get item array of container (%s): %w", getMethod, err)
|
||||
}
|
||||
|
||||
if len(arr) != 4 {
|
||||
|
@ -69,29 +69,29 @@ func (c *Client) Get(cid []byte) (*containercore.Container, error) {
|
|||
|
||||
cnrBytes, err := client.BytesFromStackItem(arr[0])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get byte array of container (%s): %w", getMethod, err)
|
||||
return nil, fmt.Errorf("get byte array of container (%s): %w", getMethod, err)
|
||||
}
|
||||
|
||||
sigBytes, err := client.BytesFromStackItem(arr[1])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get byte array of container signature (%s): %w", getMethod, err)
|
||||
return nil, fmt.Errorf("get byte array of container signature (%s): %w", getMethod, err)
|
||||
}
|
||||
|
||||
pub, err := client.BytesFromStackItem(arr[2])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get byte array of public key (%s): %w", getMethod, err)
|
||||
return nil, fmt.Errorf("get byte array of public key (%s): %w", getMethod, err)
|
||||
}
|
||||
|
||||
tokBytes, err := client.BytesFromStackItem(arr[3])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get byte array of session token (%s): %w", getMethod, err)
|
||||
return nil, fmt.Errorf("get byte array of session token (%s): %w", getMethod, err)
|
||||
}
|
||||
|
||||
var cnr containercore.Container
|
||||
|
||||
if err := cnr.Value.Unmarshal(cnrBytes); err != nil {
|
||||
// use other major version if there any
|
||||
return nil, fmt.Errorf("can't unmarshal container: %w", err)
|
||||
return nil, fmt.Errorf("unmarshal container: %w", err)
|
||||
}
|
||||
|
||||
if len(tokBytes) > 0 {
|
||||
|
@ -99,7 +99,7 @@ func (c *Client) Get(cid []byte) (*containercore.Container, error) {
|
|||
|
||||
err = cnr.Session.Unmarshal(tokBytes)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not unmarshal session token: %w", err)
|
||||
return nil, fmt.Errorf("unmarshal session token: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue