【发布时间】:2021-04-21 21:32:06
【问题描述】:
目前我正在使用它来处理用户在我的应用中输入任何错误数据:
options(shiny.sanitize.errors = TRUE)
它返回此错误消息:
Error: An error has occurred. Check your logs or contact the app author for clarification.
有没有办法将此消息的内容更改为其他内容,例如说“无效的用户名。请重试”,我不想使用 try-catch,只想更改此默认错误消息。
【问题讨论】:
-
用
tryCatch()怎么样? -
没有办法改变它。我只会处理发生的错误。当发生其他意外错误时,类似的特定全局错误消息也可能使用户感到困惑。
-
您会在整个代码中运行 tryCatch 吗?我基本上只想要 1 条通用错误消息。
-
不可能在整个应用程序中运行 tryCatch。