1
0
mirror of https://github.com/mum4k/termdash.git synced 2025-04-25 13:48:50 +08:00

Noting that error handlers must be thread-safe.

This commit is contained in:
Jakub Sobon 2019-02-24 18:03:45 -05:00 committed by GitHub
parent 1c6947618b
commit 275d95ad41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,7 @@ func RedrawInterval(t time.Duration) Option {
// ErrorHandler is used to provide a function that will be called with all
// errors that occur while the dashboard is running. If not provided, any
// errors panic the application.
// The provided function must be thread-safe.
func ErrorHandler(f func(error)) Option {
return option(func(td *termdash) {
td.errorHandler = f