updateStatesAndNotifyError updates the paused states and sends an error notification. No thread safety, caller must hold c.locker.
(errDescription string, err error)
| 265 | // updateStatesAndNotifyError updates the paused states and sends an error notification. |
| 266 | // No thread safety, caller must hold c.locker. |
| 267 | func (c *Control) updateStatesAndNotifyError(errDescription string, err error) { |
| 268 | if err == nil { |
| 269 | return |
| 270 | } |
| 271 | |
| 272 | if errDescription == "" { |
| 273 | errDescription = "Error" |
| 274 | } |
| 275 | |
| 276 | // Error notification |
| 277 | c.pauseNotification = ¬ifications.Notification{ |
| 278 | EventID: "control:error", |
| 279 | Type: notifications.Error, |
| 280 | Title: errDescription, |
| 281 | Message: err.Error(), |
| 282 | EventData: &c.pauseInfo, |
| 283 | } |
| 284 | notifications.Notify(c.pauseNotification) |
| 285 | c.pauseNotification.SyncWithState(c.states) |
| 286 | } |
| 287 | |
| 288 | func (c *Control) showNotification(title, message string) *notifications.Notification { |
| 289 | n := ¬ifications.Notification{ |
no test coverage detected