mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
always wrap errors when creating new ones with fmt.Errorf()
It doesn't really change anything in most of the cases, but it's a useful habit anyway. Fix #350.
This commit is contained in:
parent
205f52c563
commit
0e2784cd2c
24 changed files with 105 additions and 84 deletions
|
@ -140,15 +140,15 @@ func CompileAndSave(src string, o *Options) ([]byte, error) {
|
|||
}
|
||||
b, di, err := CompileWithDebugInfo(bytes.NewReader(b))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error while trying to compile smart contract file: %v", err)
|
||||
return nil, fmt.Errorf("error while trying to compile smart contract file: %w", err)
|
||||
}
|
||||
f, err := nef.NewFile(b)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error while trying to create .nef file: %v", err)
|
||||
return nil, fmt.Errorf("error while trying to create .nef file: %w", err)
|
||||
}
|
||||
bytes, err := f.Bytes()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error while serializing .nef file: %v", err)
|
||||
return nil, fmt.Errorf("error while serializing .nef file: %w", err)
|
||||
}
|
||||
out := fmt.Sprintf("%s.%s", o.Outfile, o.Ext)
|
||||
err = ioutil.WriteFile(out, bytes, os.ModePerm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue