aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-27 14:07:22 -0800
committerJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-27 14:07:22 -0800
commit31f920a06aa5d7e7cf363645dac02f6e798fffb1 (patch)
treeddd60f794c193e1a407e78b5ca94d0a83466fd78 /core
parente6855829c4df2861e779adcccbb422e7c0830afd (diff)
downloadgo-git-31f920a06aa5d7e7cf363645dac02f6e798fffb1.tar.gz
Improved objfile error handling and test coverage
Diffstat (limited to 'core')
-rw-r--r--core/object.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/object.go b/core/object.go
index 7cc8af9..9958570 100644
--- a/core/object.go
+++ b/core/object.go
@@ -8,6 +8,8 @@ import (
var (
ObjectNotFoundErr = errors.New("object not found")
+ // ErrInvalidType is returned when an invalid object type is provided.
+ ErrInvalidType = errors.New("invalid object type")
)
// TODO: Consider adding a Hash function to the ObjectReader and ObjectWriter
@@ -101,7 +103,7 @@ func ParseObjectType(value string) (typ ObjectType, err error) {
case "ref-delta":
typ = REFDeltaObject
default:
- err = errors.New("unable to parse object type")
+ err = ErrInvalidType
}
return
}