Re: [R-pkg-devel] best way the handle errors conditionally

2017-03-06 Thread Brian G. Peterson
On Mon, 2017-03-06 at 11:17 +0100, Thierry Onkelinx wrote: > I'd like your advice on handling errors conditionally within a > function. Imagine a function that does several database operations. > The user has the option to run them inside a transaction. So the code > has somewhere near the top: >

Re: [R-pkg-devel] best way the handle errors conditionally

2017-03-06 Thread Duncan Murdoch
On 06/03/2017 5:17 AM, Thierry Onkelinx wrote: Dear all, I'd like your advice on handling errors conditionally within a function. Imagine a function that does several database operations. The user has the option to run them inside a transaction. So the code has somewhere near the top: if (trans

[R-pkg-devel] best way the handle errors conditionally

2017-03-06 Thread Thierry Onkelinx
Dear all, I'd like your advice on handling errors conditionally within a function. Imagine a function that does several database operations. The user has the option to run them inside a transaction. So the code has somewhere near the top: if (transaction) { DBI::dbBegin(conn) } At the end of