How can I log or pass error messages from python back to R?

Recently, I had a very high level question about reticulate. It feels like there are alot of good tutorials out there about how objects are passed from reticulate R to python and from python to reticulate R.

One thing that is confusing me still is how can I handle error messages for when I want to deploy (put in production) my reticulate /python code ?

Suppose I have the following python function.

def my_func(a):
               print("An exception occurred")

How can I use reticulate so that R will log the error when I call Rscript.exe or R.exe (or the linux equivalents in .sh files) ?