-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherrors.go
More file actions
28 lines (23 loc) · 682 Bytes
/
Copy patherrors.go
File metadata and controls
28 lines (23 loc) · 682 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
package m68k
import (
"errors"
"fmt"
)
var (
errNoProgram = errors.New("no program loaded or memory device attached")
errBadAddress = errors.New("illegal effective address")
errBadOpcode = errors.New("illegal operation code")
errBadOpSize = errors.New("illegal operand size")
errNotImplemented = errors.New("operation code not implemented")
)
type traceableError struct {
Addr uint32
Opcode uint16
Err error
}
func newTraceableError(addr uint32, op uint16, err error) error {
return &traceableError{addr, op, err}
}
func (e *traceableError) Error() string {
return fmt.Sprintf("%s (Op: 0x%04X, PC: 0x%X)", e.Err.Error(), e.Opcode, e.Addr)
}