-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherrors.go
More file actions
98 lines (76 loc) · 2.95 KB
/
errors.go
File metadata and controls
98 lines (76 loc) · 2.95 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Package compgeo serves as a root point for several computational geometry
// packages.
package compgeo
// TypeError is returned when some input to be
// read is improperly formatted for the expected type.
type TypeError struct{}
func (fte TypeError) Error() string {
return "The input was not of the expected type, or was malformed"
}
// EmptyError is returned when some input to be read
// did not have any contents.
type EmptyError struct{}
func (ee EmptyError) Error() string {
return "The input was empty"
}
// NotManifoldError is returned when it is detected
// that the input shape to ReadOFF was not possible
// Euclidean geometry.
type NotManifoldError struct{}
func (nme NotManifoldError) Error() string {
return "The given shape was not manifold"
}
// BadEdgeError is returned from edge-processing functions
// if an edge is expected to have access to some field, or
// be initialized, when it does or is not. I.E. an edge has
// no twin for FullEdge.
type BadEdgeError struct{}
func (bee BadEdgeError) Error() string {
return "The input edge was invalid"
}
// A RangeError represents when some query attempted
// on a structure falls out of the range of the structure's
// span.
type RangeError struct{}
func (re RangeError) Error() string {
return "The query value was not in range of the structure"
}
// A BadDimensionError is returned when some function that takes
// an input dimension is given a dimension which is not defined
// for the query structure.
type BadDimensionError struct{}
func (bde BadDimensionError) Error() string {
return "The query dimension does not exist in the query structure."
}
// An InsufficientDimensionsError is returned when some
// function takes n input dimensions and was given less than
// n dimensions to work with.
type InsufficientDimensionsError struct{}
func (ide InsufficientDimensionsError) Error() string {
return "Not enough dimensions were supplied to the function"
}
// BadDCELError is returned when a query needs access to eleemnts
// of a DCEL that are not defined on a given DCEL. A good example
// would be that most queries would expect a DCEL to have at least
// three vertices.
type BadDCELError struct{}
func (bde BadDCELError) Error() string {
return "The input DCEL was not valid"
}
// BadVertexError is returned when a query needs a vertex or vertices
// which satisfy some condition which is not satisfied.
type BadVertexError struct{}
func (bve BadVertexError) Error() string {
return "The input vertex(ices) were not valid for the operation"
}
// DivideByZero is returned by functions that attempt to Divide by zero.
type DivideByZero struct{}
func (dbz DivideByZero) Error() string {
return "Division by zero. Default value to Infinity if unavoidable"
}
// UnsupportedError is returned when the input to a function is
// hypothetically valid, but is not currently supported by go-compgeo
type UnsupportedError struct{}
func (use UnsupportedError) Error() string {
return "Unsupported input configuration"
}