1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WAD @ping throws unavoidable error

Discussion in 'Support' started by noahcoad, Apr 12, 2013.

  1. noahcoad

    Joined:
    Apr 29, 2009
    Messages:
    35
    Likes Received:
    0
    If pinging an address that doesn't exist, an error is shown that can't be prevented (as far as I've tried). Makes it difficult to use in monitoring situations you want to keep ping'ing until the address becomes live.

    [​IMG]
     
  2. noahcoad

    Joined:
    Apr 29, 2009
    Messages:
    35
    Likes Received:
    0
    p.s. I realize this is a WinSocks error message, but the idea of @ping -2 response is an address is unreachable, so there should be away to prevent the system exception from bubbling up.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,730
    Likes Received:
    80
    Not reproducible here. Apparently your system or ISP is returning an 11004 (valid name, no data record) error when AFAIK everybody else returns a 11001 (invalid host). But "nothing" is definitely not a valid name!

    So you're *not* getting a -2 (unreachable) response; you're getting a DNS error and then an error return (-2). @PING will only return a -1, -2, or -3 (with no error message & exit) if you have a non-fatal error.
     
  4. noahcoad

    Joined:
    Apr 29, 2009
    Messages:
    35
    Likes Received:
    0
    Is there a way to suppress fatal errors like this?
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    Redirect it to the bit bucket:

    Code:
    ( set ping=%@ping[%address] ) > nul:
    echo %ping
    
     
    noahcoad likes this.

Share This Page