mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Since the Go memory allocator is not available to us we need to define our own error type.
19 lines
480 B
Go
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
|
|
}
|