Updating iodine to support new iodine.Error(error, map[string]string) error method

This commit is contained in:
Frederick F. Kautz IV
2015-03-25 19:12:39 -07:00
parent 68f36f5e08
commit 40e311a919
9 changed files with 119 additions and 90 deletions

View File

@@ -16,7 +16,7 @@ type donut struct {
}
// NewDonut - instantiate new donut driver
func NewDonut(root string) (Donut, *iodine.Error) {
func NewDonut(root string) (Donut, error) {
nodes := make(map[string]Node)
nodes["localhost"] = &localDirectoryNode{root: root}
driver := &donut{
@@ -26,7 +26,7 @@ func NewDonut(root string) (Donut, *iodine.Error) {
for nodeID, node := range nodes {
bucketIDs, err := node.GetBuckets()
if err != nil {
return nil, iodine.New(err, map[string]string{"root": root})
return nil, iodine.Error(err, map[string]string{"root": root})
}
for _, bucketID := range bucketIDs {
tokens := strings.Split(bucketID, ":")
@@ -38,7 +38,7 @@ func NewDonut(root string) (Donut, *iodine.Error) {
driver.buckets[tokens[0]] = bucket
}
if err = driver.buckets[tokens[0]].AddNode(nodeID, bucketID); err != nil {
return nil, iodine.New(err, map[string]string{"root": root})
return nil, iodine.Error(err, map[string]string{"root": root})
}
}
}