added logging when login or hook fails. helps troubleshoot common issues

This commit is contained in:
Brad Rydzewski
2015-04-11 15:46:30 -07:00
parent ab3df4bd65
commit eda3cfbe4b
4 changed files with 50 additions and 21 deletions

View File

@@ -61,6 +61,9 @@ func (db *DB) GetBuildLast(repo string) (*common.Build, error) {
build := &common.Build{}
err := db.View(func(t *bolt.Tx) error {
raw := t.Bucket(bucketBuildSeq).Get(key)
if raw == nil {
return ErrKeyNotFound
}
num := binary.LittleEndian.Uint32(raw)
key = []byte(repo + "/" + strconv.FormatUint(uint64(num), 10))
return get(t, bucketBuild, key, build)