omaha: support using status codes as error values

This commit is contained in:
Michael Marineau 2015-11-11 15:10:30 -08:00
parent 5e54ada1e9
commit 2cf1d8f13e

View file

@ -155,8 +155,14 @@ const (
// Extra error values
AppInvalidVersion AppStatus = "error-invalidVersion"
AppInternalError AppStatus = "error-internal"
)
// Make AppStatus easy to use as an error
func (a AppStatus) Error() string {
return string(a)
}
type UpdateStatus string
const (
@ -168,3 +174,8 @@ const (
UpdateHashError UpdateStatus = "error-hash"
UpdateInternalError UpdateStatus = "error-internal"
)
// Make UpdateStatus easy to use as an error
func (u UpdateStatus) Error() string {
return string(u)
}