Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ec9432d7b | |||
| 044d49a9dc |
@@ -1,5 +1,5 @@
|
|||||||
package constants
|
package constants
|
||||||
|
|
||||||
const Version = "0.0.4b"
|
const Version = "0.0.4c"
|
||||||
|
|
||||||
const ApiVersion = 1
|
const ApiVersion = 1
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"cloudsave/pkg/remote/client"
|
"cloudsave/pkg/remote/client"
|
||||||
"cloudsave/pkg/repository"
|
"cloudsave/pkg/repository"
|
||||||
"cloudsave/pkg/tools/archive"
|
"cloudsave/pkg/tools/archive"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@@ -134,6 +135,9 @@ func (s *Service) MakeBackup(gameID string) error {
|
|||||||
|
|
||||||
src, err := s.repo.ReadBlob(id)
|
src, err := s.repo.ReadBlob(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errors.Is(err, repository.ErrNotFound) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if v, ok := src.(io.Closer); ok {
|
if v, ok := src.(io.Closer); ok {
|
||||||
|
|||||||
@@ -313,6 +313,9 @@ func (l *LazyRepository) ReadBlob(id Identifier) (io.ReadSeekCloser, error) {
|
|||||||
slog.Debug("loading read buffer...", "id", id)
|
slog.Debug("loading read buffer...", "id", id)
|
||||||
dst, err := os.OpenFile(filepath.Join(path, "data.tar.gz"), os.O_RDONLY, 0)
|
dst, err := os.OpenFile(filepath.Join(path, "data.tar.gz"), os.O_RDONLY, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
|
return nil, fmt.Errorf("failed to open blob: %w", ErrNotFound)
|
||||||
|
}
|
||||||
return nil, fmt.Errorf("failed to open blob: %w", err)
|
return nil, fmt.Errorf("failed to open blob: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user