|
|
@ -89,15 +89,15 @@ func callBackPostReturn(ctx context.Context, url, command string, input interfac
|
|
|
|
b, err := Post(ctx, url, nil, input, callbackConfig.CallbackTimeOut)
|
|
|
|
b, err := Post(ctx, url, nil, input, callbackConfig.CallbackTimeOut)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue {
|
|
|
|
if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue {
|
|
|
|
log.ZWarn(ctx, "callback failed but continue", err, "url", url, "err", err.Error())
|
|
|
|
log.ZWarn(ctx, "callback failed but continue", err, "url", url)
|
|
|
|
return nil
|
|
|
|
return errs.ErrCallbackContinue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return errs.ErrNetwork.Wrap(err.Error())
|
|
|
|
return errs.ErrNetwork.Wrap(err.Error())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if err = json.Unmarshal(b, output); err != nil {
|
|
|
|
if err = json.Unmarshal(b, output); err != nil {
|
|
|
|
if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue {
|
|
|
|
if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue {
|
|
|
|
log.ZWarn(ctx, "callback failed but continue", err, "url", url, "err", err.Error())
|
|
|
|
log.ZWarn(ctx, "callback failed but continue", err, "url", url)
|
|
|
|
return nil
|
|
|
|
return errs.ErrCallbackContinue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return errs.ErrData.Wrap(err.Error())
|
|
|
|
return errs.ErrData.Wrap(err.Error())
|
|
|
|
}
|
|
|
|
}
|
|
|
|