Skip to content

Commit 945ab0c

Browse files
committed
Classify missing Go session files
Return os.ErrNotExist from the in-memory SQLite provider so the runtime can create a workspace after an ENOENT read. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 812b44f2-ef93-4b32-b051-c7092f612279
1 parent 105ee80 commit 945ab0c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

go/internal/e2e/session_fs_sqlite_e2e_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package e2e
33
import (
44
"encoding/json"
55
"fmt"
6+
"os"
67
"sort"
78
"strings"
89
"sync"
@@ -54,7 +55,7 @@ func (p *inMemorySqliteProvider) ReadFile(path string) (string, error) {
5455
defer p.mu.Unlock()
5556
content, ok := p.files[path]
5657
if !ok {
57-
return "", fmt.Errorf("file not found: %s", path)
58+
return "", fmt.Errorf("%s: %w", path, os.ErrNotExist)
5859
}
5960
return content, nil
6061
}
@@ -97,7 +98,7 @@ func (p *inMemorySqliteProvider) Stat(path string) (*copilot.SessionFSFileInfo,
9798
IsFile: true, IsDirectory: false, Size: int64(len(content)), Mtime: now, Birthtime: now,
9899
}, nil
99100
}
100-
return nil, fmt.Errorf("not found: %s", path)
101+
return nil, fmt.Errorf("%s: %w", path, os.ErrNotExist)
101102
}
102103

103104
func (p *inMemorySqliteProvider) MakeDirectory(path string, recursive bool, mode *int) error {

0 commit comments

Comments
 (0)