Imported Upstream version 2.4.2
[scm/test.git] / git / odb / errors.go
1 package odb
2
3 import "fmt"
4
5 // UnexpectedObjectType is an error type that represents a scenario where an
6 // object was requested of a given type "Wanted", and received as a different
7 // _other_ type, "Wanted".
8 type UnexpectedObjectType struct {
9         // Got was the object type requested.
10         Got ObjectType
11         // Wanted was the object type received.
12         Wanted ObjectType
13 }
14
15 // Error implements the error.Error() function.
16 func (e *UnexpectedObjectType) Error() string {
17         return fmt.Sprintf("git/odb: unexpected object type, got: %q, wanted: %q", e.Got, e.Wanted)
18 }