From malsburg at gmail.com  Fri Feb  3 11:49:37 2012
From: malsburg at gmail.com (Titus von der Malsburg)
Date: Fri, 3 Feb 2012 11:49:37 +0100
Subject: [Rd] Resume processing after warning handler.
Message-ID: <CAM+LvrB21RWJJ2UcO6xaNbb5X9xUJXju04pwEJCwAt79qjdUtQ@mail.gmail.com>

Dear list!

I have a script that processes a large number of data files.  When one
file fails to process correctly, I want the script to write a message
and to continue with the next file.  I achieved this with tryCatch:

  for (f in files)
    tryCatch({heavy.lifting(f)}, error=function(e) log.error.to.file(e))

I also want to log warning messages and tried something like this:

  for (f in files)
    tryCatch({heavy.lifting(f)},
             warning=function(w) {log.warning.to.file(w)},
             error=function(e) {log.error.to.file(e)})

Unfortunately, this aborts processing when a warning is generated.  My
question: how can I resume processing after I logged the warning as if
nothing had happened?  My understanding of the man page is that his is
not possible with tryCatch but I'm not sure.

Thanks for any suggestions!

  Titus



[Rd] Resume processing after warning handler.
Titus von der Malsburg