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:
parent
1c6947618b
commit
275d95ad41
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user