| 12345678910111213141516171819202122 |
- package backend
- import (
- "errors"
- "os"
- )
- func ClassifyOpen(err error) string {
- if err == nil {
- return ""
- }
- if os.IsNotExist(err) {
- return "not_found"
- }
- if os.IsPermission(err) {
- return "permission"
- }
- if errors.Is(err, ErrNotConnected) {
- return "disconnected"
- }
- return "other"
- }
|