Giter VIP home page Giter VIP logo

Comments (4)

jeroen avatar jeroen commented on July 17, 2024

Yeah I'm not entirely sure yet how to deal with this. If you are downloading many files, and one fails, should the entire operation be aborted? What about files that you already downloaded?

from ssh.

richfitz avatar richfitz commented on July 17, 2024

My thoughts:

I personally really dislike warnings in R - they're easily lost and don't get printed at a useful time. If it's informational and requires no user action I prefer message and if it's likely something terrible happened then I prefer errors (same idea as https://dave.cheney.net/2015/11/05/lets-talk-about-logging) but I recognise that's just a personal view.

How about return a logical vector TRUE/FALSE for success and include a must_work argument (so that if all files must be transferred successfully then it's easy to throw).

Because of the manipulation of global state you can't make the whole thing atomic (all work or none work) and scp itself doesn't try.

from ssh.

jxu avatar jxu commented on July 17, 2024

What about

options(warn=2)

from ssh.

yaotianran avatar yaotianran commented on July 17, 2024

With tryCatch one can easily capture errors or warnings

exception = tryCatch(
      {
       # something you want to do
      },
      error = function(e) e,
      warning = function(w) w
   )
if (inherits(exception, 'warning')) {
   stop('An error occured.')
}

from ssh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.