ErrorHandler: Handling errors

Description Usage Arguments Format Examples

View source: R/errorhandler.R

Description

Handler class to handle errors in the Dispatcher.

Usage

1
2
3

Arguments

callback

A function that takes (bot, error) as arguments.

x

Object to be tested.

Format

An R6Class object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
updater <- Updater(token = "TOKEN")

# Create error callback
error_callback <- function(bot, error){
  warning(simpleWarning(conditionMessage(error), call = "Updates polling"))
}

# Register it to the updater's dispatcher
updater$dispatcher$add_handler(ErrorHandler(error_callback))
# or
updater <- updater + ErrorHandler(error_callback)

## End(Not run)

ebeneditos/telegram.bot documentation built on Dec. 2, 2018, 1:18 p.m.