-
Notifications
You must be signed in to change notification settings - Fork 110
/
errors.go
27 lines (20 loc) · 1011 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package spatialmath
import "github.com/pkg/errors"
// ErrGeometryTypeUnsupported is an error that is returned when an unsupported GeometryType is specified
// (either implicitly or explicitly) in a GeometryConfig.
var ErrGeometryTypeUnsupported = errors.New("unsupported Geometry type")
func newBadGeometryDimensionsError(g Geometry) error {
return errors.Errorf("Invalid dimension(s) for Geometry type %T", g)
}
func newBadCapsuleLengthError(l, r float64) error {
return errors.Errorf("Capsule total length %f cannot be less than 2x radius %f", l, r)
}
func newCollisionTypeUnsupportedError(g1, g2 Geometry) error {
return errors.Errorf("Collisions between %T and %T are not supported", g1, g2)
}
func newOrientationTypeUnsupportedError(orientationType string) error {
return errors.Errorf("Orientation type %s unsupported in json configuration", orientationType)
}
func newRotationMatrixInputError(m []float64) error {
return errors.Errorf("input slice has %d elements, need exactly 9", len(m))
}