-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherrors.go
More file actions
50 lines (41 loc) · 1.17 KB
/
errors.go
File metadata and controls
50 lines (41 loc) · 1.17 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
package semanticrouter
import "fmt"
// ErrNoRouteFound is an error that is returned when no route is found.
type ErrNoRouteFound struct {
Message string
Utterance string
}
// Error returns the error message.
func (e ErrNoRouteFound) Error() string {
return e.Message + " : utterance : " + e.Utterance
}
// ErrEncoding is an error that is returned when an error occurs during encoding.
type ErrEncoding struct {
Message string
}
// Error returns the error message.
func (e ErrEncoding) Error() string {
return e.Message
}
// ErrGetEmbedding is an error that is returned when an error occurs during getting an embedding.
type ErrGetEmbedding struct {
Message string
Storage Store
}
// Error returns the error message.
func (e ErrGetEmbedding) Error() string {
return e.Message
}
// ErrEmbeddingLengthMismatch is an error that is returned when an embedding has a different length than the query vector.
type ErrEmbeddingLengthMismatch struct {
EmbeddingLength int
QueryLength int
}
// Error returns the error message.
func (e ErrEmbeddingLengthMismatch) Error() string {
return fmt.Sprintf(
"embedding length mismatch: %d != %d",
e.EmbeddingLength,
e.QueryLength,
)
}