Sphire Mantis' API Documentation
import "github.com/sphireinc/mantis/errors"
Errors holds our code, message, timestamp
type Errors struct {
code int32
message string
timestamp time.Time
}
func New(code int32, message string, args []any) *Errors
New creates a new errors instance Usage:
err = New(100, "%v is %v years old", []any{"Kim", 22})
- or without args -
err := New(100, "some message", nil)
func (e *Errors) Code() int32
Code returns the error code
func (e *Errors) Marshal() error
Marshal creates a Go STD error from our Errors object
func (e *Errors) MarshalJSON() ([]byte, error)
MarshalJSON implements the JSON encoding interface
func (e *Errors) Message() string
Message returns the error message
func (e *Errors) Time() time.Time
Time returns the error timestamp
Generated by gomarkdoc