Skip to content

"Error: attempt to apply non-function" - tryCatchLog package must be attached to work #41

@chrsigg

Description

@chrsigg

Using tryCatchLog without attaching the package produces an error:

tryCatchLog::tryCatchLog({
 stop("stop")
})
#> Error in h(simpleError(msg, call)): attempt to apply non-function

This is not ideal when using tryCatchLog in a script, and a real problem when using it inside a package. It forces the package author to specify the dependency using Depends: in the DESCRIPTION file, which should be avoided as it modifies the search path (see http://r-pkgs.had.co.nz/namespace.html#namespace for example).

Please consider rewriting the .onAttach function such that your package can be used without having to attach it.

And thank you for your work. Having access to the full stack trace inside tryCatch blocks is much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions