code: func (e *Error) MarshalJSON() ([]byte, error) {
  	return json.Marshal(&struct {
  		Class ErrClass `json:"class"`
  		Code  ErrCode  `json:"code"`
  		Msg   string   `json:"message"`
  	}{
  		Class: e.class,
  		Code:  e.code,
  		Msg:   e.getMsg(),
  	})
  }
docs: // MarshalJSON implements json.Marshaler interface.