inst/app/error_class.R

setClass(
  Class = 'appError',
  slots = list(
    error_msg = 'character'
  )
)


setGeneric(
  'errorMessage', function(x){
    standardGeneric('errorMessage')
  }
)

setMethod(
  f = 'errorMessage',
  signature = 'appError',
  definition = function(x){
    cat(x@error_msg)
    
    sendSweetAlert(
      session = session,
      title = "Error!",
      text = x@error_msg,
      type = "error"
    )
  }
)
aljrico/hs_balancedata documentation built on Dec. 3, 2019, 5:47 p.m.