Commit 01b24b1e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 351d5dfa
......@@ -19,15 +19,10 @@
// Package demo provides overlayed storage, similar to DemoStorage in ZODB/py.
//
// Storage combines base and δ storages as if δ transactional log was logically
// Storage combines base and δ storages as if δ transactional log is logically
// appended to base.
//
// XXX
// XXX link to DemoStorage
package demo
// TODO tests
import (
"context"
"errors"
......@@ -52,8 +47,12 @@ type Storage struct {
// Close implements zodb.IStorageDriver .
func (d *Storage) Close() error {
// XXX errctx?
func (d *Storage) Close() (err error) {
defer func() {
if err != nil {
err = &zodb.OpError{URL: d.URL(), Op: "close", Err: err}
}
}()
err1 := d.δ.Close()
err2 := d.base.Close()
......@@ -65,7 +64,7 @@ func (d *Storage) Close() error {
func (d *Storage) Sync(ctx context.Context) (head zodb.Tid, err error) {
defer func() {
if err != nil {
err = &zodb.OpError{URL: d.URL(), Op: "sync", Args: xid, Err: err}
err = &zodb.OpError{URL: d.URL(), Op: "sync", Err: err}
}
}()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment