-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
37 lines (31 loc) · 974 Bytes
/
errors.go
File metadata and controls
37 lines (31 loc) · 974 Bytes
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
// Code generated by idiomgen. DO NOT EDIT.
package nnapi
import "fmt"
// Error represents an NDK error code.
type Error int32
const (
ErrOutOfMemory Error = 1
ErrIncomplete Error = 2
ErrUnexpectedNull Error = 3
ErrBadData Error = 4
ErrOpFailed Error = 5
ErrBadState Error = 6
ErrUnmappable Error = 7
ErrOutputInsufficientSize Error = 8
ErrUnavailableDevice Error = 9
ErrMissedDeadlineTransient Error = 10
ErrMissedDeadlinePersistent Error = 11
ErrResourceExhaustedTransient Error = 12
ErrResourceExhaustedPersistent Error = 13
ErrDeadObject Error = 14
)
func (e Error) Error() string {
return fmt.Sprintf("nnapi: error %d", int(e))
}
// result converts a C result code to nil or an Error.
func result[T ~int32 | ~uint32 | ~int64](r T) error {
if r >= 0 {
return nil
}
return Error(r)
}