toughen up error handling for invalid fid

This commit is contained in:
Chris Lu
2013-12-09 13:53:24 -08:00
parent 512899e6a6
commit 1bf75f7f73
3 changed files with 22 additions and 12 deletions

View File

@@ -25,8 +25,8 @@ func ParseFileId(fid string) (*FileId, error) {
}
vid_string, key_hash_string := a[0], a[1]
volumeId, _ := NewVolumeId(vid_string)
key, hash := ParseKeyHash(key_hash_string)
return &FileId{VolumeId: volumeId, Key: key, Hashcode: hash}, nil
key, hash, e := ParseKeyHash(key_hash_string)
return &FileId{VolumeId: volumeId, Key: key, Hashcode: hash}, e
}
func (n *FileId) String() string {
bytes := make([]byte, 12)