aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-15 13:15:00 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-15 13:15:00 +0200
commit7bec0b1f134d213e7505fc2ac03ffea26f2193cc (patch)
treee263cccd84406843eacbc6bd184acdacb25a49d1 /cache
parentb478cd1bcb4756b20f7f4b15fcf81f23e1a60a02 (diff)
downloadgit-bug-7bec0b1f134d213e7505fc2ac03ffea26f2193cc.tar.gz
bug: add a data validation process to avoid merging incorrect operations
Diffstat (limited to 'cache')
-rw-r--r--cache/bug_cache.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go
index 67c16e96..b0dbb6cc 100644
--- a/cache/bug_cache.go
+++ b/cache/bug_cache.go
@@ -44,7 +44,10 @@ func (c *BugCache) AddCommentWithFiles(message string, files []git.Hash) error {
return err
}
- operations.CommentWithFiles(c.bug, author, message, files)
+ err = operations.CommentWithFiles(c.bug, author, message, files)
+ if err != nil {
+ return err
+ }
return c.notifyUpdated()
}
@@ -74,7 +77,10 @@ func (c *BugCache) Open() error {
return err
}
- operations.Open(c.bug, author)
+ err = operations.Open(c.bug, author)
+ if err != nil {
+ return err
+ }
return c.notifyUpdated()
}
@@ -85,7 +91,10 @@ func (c *BugCache) Close() error {
return err
}
- operations.Close(c.bug, author)
+ err = operations.Close(c.bug, author)
+ if err != nil {
+ return err
+ }
return c.notifyUpdated()
}
@@ -96,7 +105,10 @@ func (c *BugCache) SetTitle(title string) error {
return err
}
- operations.SetTitle(c.bug, author, title)
+ err = operations.SetTitle(c.bug, author, title)
+ if err != nil {
+ return err
+ }
return c.notifyUpdated()
}