1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00
gopher-os/kernel/error.go
Achilleas Anagnostopoulos d5a4c43406 Define type for kernel error messages
Since the Go memory allocator is not available to us we need to define
our own error type.
2017-05-31 14:59:47 +01:00

19 lines
480 B
Go

package kernel
// Error describes a kernel kerror. All kernel errors must be defined as global
// variables that are pointers to the Error structure. This requirement stems
// from the fact that the Go allocator is not available to us so we cannot use
// errors.New.
type Error struct {
// The module where the error occurred.
Module string
// The error message
Message string
}
// Error implements the error interface.
func (e *Error) Error() string {
return e.Message
}