File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ func (c *Client) Backup(ctx context.Context, file string) error {
4646
4747 tf , err := os .Create (file )
4848 if err != nil {
49- return nil
49+ return err
5050 }
5151
5252 defer func () {
@@ -55,7 +55,7 @@ func (c *Client) Backup(ctx context.Context, file string) error {
5555
5656 gw , err := gzip .NewWriterLevel (tf , gzip .BestCompression )
5757 if err != nil {
58- return nil
58+ return err
5959 }
6060
6161 defer func () {
@@ -68,8 +68,13 @@ func (c *Client) Backup(ctx context.Context, file string) error {
6868 _ = tw .Close ()
6969 }()
7070
71- _ = addToArchive (tw , path .Join (dirPath , ObjectsFileName ))
72- _ = addToArchive (tw , path .Join (dirPath , RelationsFileName ))
71+ if err := addToArchive (tw , path .Join (dirPath , ObjectsFileName )); err != nil {
72+ return err
73+ }
74+
75+ if err := addToArchive (tw , path .Join (dirPath , RelationsFileName )); err != nil {
76+ return err
77+ }
7378
7479 return nil
7580}
You can’t perform that action at this time.
0 commit comments