PutAlert puts an alert in the given data.
(alert Alert, alertInYield bool)
| 61 | |
| 62 | // PutAlert puts an alert in the given data. |
| 63 | func (d *Data) PutAlert(alert Alert, alertInYield bool) { |
| 64 | if alertInYield { |
| 65 | if d.Yield == nil { |
| 66 | d.Yield = map[string]interface{}{} |
| 67 | } |
| 68 | d.Yield["Alert"] = &alert |
| 69 | } else { |
| 70 | d.Alert = &alert |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // SetAlert sets alert in the given data for given error. |
| 75 | func (d *Data) SetAlert(err error, alertInYield bool) { |