It seems as though fiery/routr/reqres based apps don't currently have a mechanism for reporting trace stacks (of errors), which makes debugging complex applications difficult. Here's a minimal example of the information reported in a request error (BTW, any idea why the error is being reported twice?):
library(fiery)
library(routr)
app <- Fire$new()
route <- Route$new()
route$add_handler('get', '*', function(request, response, keys, ...) {
response$type <- 'html'
response$status <- 200L
response$body <- '<h1>All your AI are belong to us</h1>'
1 + "a"
FALSE
})
router <- RouteStack$new()
router$add_route(route, "main")
app$attach(router)
app$ignite(showcase = TRUE)
Fire started at 127.0.0.1:8080
error: non-numeric argument to binary operator
error: non-numeric argument to binary operator
With shiny, if you run an app that is saved to disk, it reports the line at which the error occurs -- would it be possible to add something similar to the fiery/routr/reqres stack?
I don't think it is possible to get the same line-number reporting as shiny, as fiery code is not sourced in the same way... A better backtrace is important though, maybe with a logger_backtrace()
It seems as though fiery/routr/reqres based apps don't currently have a mechanism for reporting trace stacks (of errors), which makes debugging complex applications difficult. Here's a minimal example of the information reported in a request error (BTW, any idea why the error is being reported twice?):
With shiny, if you run an app that is saved to disk, it reports the line at which the error occurs -- would it be possible to add something similar to the fiery/routr/reqres stack?