Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
40e2fe99
Commit
40e2fe99
authored
Jul 27, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b90ada39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+7
-6
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
40e2fe99
...
...
@@ -75,6 +75,7 @@ import (
"lab.nexedi.com/kirr/neo/go/xcommon/xio"
"lab.nexedi.com/kirr/go123/xbytes"
"lab.nexedi.com/kirr/go123/xerr"
)
// FileHeader represents file header
...
...
@@ -173,25 +174,25 @@ func (dh *DataHeader) err(subj string, err error) error {
}
//
x
err is an interface for something which can create errors
//
i
err is an interface for something which can create errors
// it is used by TxnHeader and DataHeader to create appropriate errors with their context
type
x
err
interface
{
type
i
err
interface
{
err
(
subj
string
,
err
error
)
error
}
// errf is syntactic shortcut for err and fmt.Errorf
func
errf
(
e
x
err
,
subj
,
format
string
,
a
...
interface
{})
error
{
func
errf
(
e
i
err
,
subj
,
format
string
,
a
...
interface
{})
error
{
return
e
.
err
(
subj
,
fmt
.
Errorf
(
format
,
a
...
))
}
// decodeErr is syntactic shortcut for errf("decode", ...)
// TODO in many places "decode" -> "selfcheck"
func
decodeErr
(
e
x
err
,
format
string
,
a
...
interface
{})
error
{
func
decodeErr
(
e
i
err
,
format
string
,
a
...
interface
{})
error
{
return
errf
(
e
,
"decode"
,
format
,
a
...
)
}
// bug panics with errf("bug", ...)
func
bug
(
e
x
err
,
format
string
,
a
...
interface
{})
{
func
bug
(
e
i
err
,
format
string
,
a
...
interface
{})
{
panic
(
errf
(
e
,
"bug"
,
format
,
a
...
))
}
...
...
@@ -1258,7 +1259,7 @@ func (fs *FileStorage) Iterate(tidMin, tidMax zodb.Tid) zodb.IStorageIterator {
// computeIndex builds new in-memory index for FileStorage
// XXX naming
func
(
fs
*
FileStorage
)
computeIndex
(
ctx
context
.
Context
)
(
index
*
Index
,
err
error
)
{
// TODO err ctx <file>: <reindex>:
defer
xerr
.
Contextf
(
&
err
,
"%s: reindex"
,
fs
.
file
.
Name
())
index
=
IndexNew
()
index
.
TopPos
=
txnValidFrom
...
...
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