From d@rocz|g @end|ng |rom r@pporter@net  Sat Jun  8 13:42:01 2019
From: d@rocz|g @end|ng |rom r@pporter@net (=?UTF-8?Q?Gergely_Dar=C3=B3czi?=)
Date: Sat, 8 Jun 2019 13:42:01 +0200
Subject: [Rd] Determining the exit code of an "almost finished" R script
Message-ID: <CAPvvxJUyDVV4xe5=zPJzWs=OeD0DtSw1iWFP90LNn1apu+VCQg@mail.gmail.com>

Dear All,

I'm using "reg.finalizer" in a function that is to be called in R scripts
to do some cleanup on success. I have not found a way to run the function
only if the script run without errors, so when the exit code is expected to
be 0.

What I've tried is checking "geterrmessage()", but unfortunately it's not
perfect: if an error was handled with eg "tryCatch" previously, that
message still shows up there.

Is there any better way of figuring out in "reg.finalizer" or ".Last" if
the session run OK or exiting with !0 exit code?

Thanks,
Gergely

	[[alternative HTML version deleted]]



[Rd] Determining the exit code of an "almost finished" R script
=?UTF-8?Q?Gergely_Dar=C3=B3czi?=