- SyncStoresCategory
- TaskError for json output.
This commit is contained in:
@@ -43,6 +43,20 @@ type ITask interface {
|
||||
json.Marshaler
|
||||
}
|
||||
|
||||
type TaskError struct {
|
||||
error
|
||||
}
|
||||
|
||||
func (t *TaskError) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(t.Error())
|
||||
}
|
||||
|
||||
func NewTaskError(err error) *TaskError {
|
||||
return &TaskError{
|
||||
err,
|
||||
}
|
||||
}
|
||||
|
||||
type BaseTask struct {
|
||||
Name string `json:"name"`
|
||||
ID string `json:"id"`
|
||||
@@ -61,10 +75,11 @@ type BaseTask struct {
|
||||
FailedJobCount int `json:"failedJobCount"`
|
||||
Status int `json:"status"`
|
||||
|
||||
Result []interface{} `json:"result"`
|
||||
Err error `json:"err"`
|
||||
Children TaskList `json:"children"`
|
||||
DetailErrList []error `json:"detailErrList"`
|
||||
Result []interface{} `json:"result"`
|
||||
Children TaskList `json:"children"`
|
||||
|
||||
Err error `json:"err"`
|
||||
DetailErrList []error `json:"detailErrList"`
|
||||
|
||||
finishChan chan int
|
||||
C <-chan int `json:"-"`
|
||||
|
||||
Reference in New Issue
Block a user