Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
a0af9f5e
Commit
a0af9f5e
authored
9 years ago
by
Tommi Virtanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If ErrNoRepo is not an error value anymore, then make it an error type
parent
a7432903
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
repo/fsrepo/fsrepo.go
repo/fsrepo/fsrepo.go
+11
-2
No files found.
repo/fsrepo/fsrepo.go
View file @
a0af9f5e
...
...
@@ -40,11 +40,20 @@ Please run the ipfs migration tool before continuing.
` + migrationInstructions
var (
ErrNoRepo
=
func
(
path
string
)
error
{
return
fmt
.
Errorf
(
"no ipfs repo found in '%s'. please run: ipfs init "
,
path
)
}
ErrNoVersion = errors.New("no version file found, please run 0-to-1 migration tool.\n" + migrationInstructions)
ErrOldRepo = errors.New("ipfs repo found in old '~/.go-ipfs' location, please run migration tool.\n" + migrationInstructions)
)
type NoRepoError struct {
Path string
}
var _ error = NoRepoError{}
func (err NoRepoError) Error() string {
return fmt.Sprintf("no ipfs repo found in '%s'. please run: ipfs init ", err.Path)
}
const (
leveldbDirectory = "datastore"
flatfsDirectory = "blocks"
...
...
@@ -172,7 +181,7 @@ func checkInitialized(path string) error {
if isInitializedUnsynced(alt) {
return ErrOldRepo
}
return
Err
NoRepo
(
path
)
return NoRepo
Error{Path:
path
}
}
return nil
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment