Skip to content

enh: Change the default value of debug to a FALSE-like sentinel value #962

@schloerke

Description

@schloerke

There are multiple reports of confusion around debug and the default error handler.

  • Errors are displayed locally when interactive()
  • Errors are not displayed when deployed

Default debug value:

plumber/R/plumber.R

Lines 1338 to 1340 in 7f51e24

default_debug <- function() {
interactive()
}

Proposal

Change the default value of debug to behave like a FALSE value.

To maintain least surprise (default to same locally, display a message with instructions on how to turn in on:

Error reporting has been turned off by default. See `pr_set_debug` for more details. 
To disable this message, setting a debug value.

Tasks

  • Change the default value of debug to behave like a FALSE value.
  • Add rlang::inform(.frequency="once", .frequency_id="pr_set_debug_message") message.
    • This should only be displayed if rlang::is_interactive() is TRUE.
  • Add #* @plumber example within pr_set_debug() docs to show to to set the value within a plumbed file
  • News entry of changed behavior

Metadata

Metadata

Assignees

Labels

help wantedSolution is well-specified enough that any community member could fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions