• SyncWx Issue

    From Daryl Stout@1:103/705 to KenDB3 on Wed Jan 3 19:52:43 2018
    Ken,

    I've noticed in the last few logons with that SyncWx app, the following error message:

    !Javascript c:\sbbs\xtrn\syncwx\weather.js line 103: SyntaxError: JSON.parse

    Any idea what that means?? I'd hate to have to remove that app from the system...especially considering ham radio and weather are the main themes of my BBS.

    Daryl Stout, WX1DER, Sysop
    The Thunderbolt BBS, Little Rock, Arkansas

    ---
    * Synchronet * The Thunderbolt BBS - wx1der.dyndns.org
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nightfox@1:103/705 to KenDB3 on Wed Jan 3 20:57:28 2018
    Re: SyncWx Issue
    By: Daryl Stout to KenDB3 on Wed Jan 03 2018 07:52 pm

    I've noticed in the last few logons with that SyncWx app, the following error message:

    !Javascript c:\sbbs\xtrn\syncwx\weather.js line 103: SyntaxError: JSON.parse

    I noticed that on my BBS as well.

    Nightfox

    ---
    * Synchronet * Digital Distortion: digitaldistortionbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Nightfox on Wed Jan 3 21:27:05 2018
    Re: SyncWx Issue
    By: Nightfox to KenDB3 on Wed Jan 03 2018 08:57 pm

    Re: SyncWx Issue
    By: Daryl Stout to KenDB3 on Wed Jan 03 2018 07:52 pm

    I've noticed in the last few logons with that SyncWx app, the following error message:

    !Javascript c:\sbbs\xtrn\syncwx\weather.js line 103: SyntaxError: JSON.parse

    I noticed that on my BBS as well.

    It's working here. I assume the web-site where it pulls its data must be down or returning something unexpeced. Hopefully it corrects itself.

    digital man

    This Is Spinal Tap quote #11:
    Nigel Tufnel: No. no. That's it, you've seen enough of that one.
    Norco, CA WX: 65.3oF, 34.0% humidity, 0 mph SW wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.03-Win32
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From echicken@1:103/705 to Daryl Stout on Thu Jan 4 00:47:03 2018
    Re: SyncWx Issue
    By: Daryl Stout to KenDB3 on Wed Jan 03 2018 19:52:43

    !Javascript c:\sbbs\xtrn\syncwx\weather.js line 103: SyntaxError: JSON.parse

    Any idea what that means?? I'd hate to have to remove that app from the

    The script is receiving a response from the Weather Underground API which it is unable to parse as valid JSON data.

    If this happens consistently, then it's possible that something about the API has changed, and Kenny will need to refactor the script for that.

    If it happens intermittently, then it isn't a big problem.

    In either case, My suggestion to Kenny would be to wrap lines 364 through 367 in a try ... catch statement:

    try {

    forecast();
    console.pause();
    console.clear();
    console.aborted = false;

    } catch (err) {

    // maybe log the error here

    } finally {

    exit();

    }

    This should have the effect of making the script fail silently (user sees nothing except maybe a bit of a delay) if something goes wrong. The forecast() function does a few things (HTTP request, JSON parse) that can throw errors, so it would be good to catch them.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    * Synchronet * electronic chicken bbs - bbs.electronicchicken.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From KenDB3@1:103/705 to echicken on Thu Jan 4 02:31:05 2018
    Re: SyncWx Issue
    By: Daryl Stout to KenDB3 on Wed Jan 03 2018 19:52:43

    !Javascript c:\sbbs\xtrn\syncwx\weather.js line 103: SyntaxError: JSON.parse

    Any idea what that means?? I'd hate to have to remove that app from the

    The script is receiving a response from the Weather Underground API which it is unable to parse as valid JSON data.

    If this happens consistently, then it's possible that something about the API has changed, and Kenny will need to refactor the script for that.

    If it happens intermittently, then it isn't a big problem.

    In either case, My suggestion to Kenny would be to wrap lines 364 through 367 in a try ... catch statement:

    try {

    forecast();
    console.pause();
    console.clear();
    console.aborted = false;

    } catch (err) {

    // maybe log the error here

    } finally {

    exit();

    }

    This should have the effect of making the script fail silently (user sees nothing except maybe a bit of a delay) if something goes wrong. The forecast() function does a few things (HTTP request, JSON parse) that can throw errors, so it would be good to catch them.

    Thanks EC. I tried the door on my own board and did not get the error. Whatever was happening at Wunderground is fine now. I've seen it not able to respond several times before, but it usually clears itself up within an hour every time I have seen it. Typically it is clear in a matter of minutes.

    I have seen something similar in another JSON response before, where the site would toss a 500 error, so it would fulfill the GET request (and not look undefined) but would hack up a lung when the script tries to parse the JSON.

    I like the solution, I'll implement it as soon as I get a chance. Right now I am preparing for a really bad winter storm up here in Rhode Island. I fully expect to lose power for a day or three.

    ~KenDB3

    ---
    * Synchronet * KD3net-Rhode Island's only BBS about nothing. http://bbs.kd3.us
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Daryl Stout@1:103/705 to KenDB3 on Thu Jan 4 14:13:46 2018
    Re: Re: SyncWx Issue
    By: KenDB3 to echicken on Thu Jan 04 2018 02:31 am

    Ken,

    I like the solution, I'll implement it as soon as I get a chance. Right now I am preparing for a really bad winter storm up here in Rhode Island. I fully expect to lose power for a day or three.

    You take care of preparing for that major winter storm...the BBS can wait.

    At least I know I'm not the only one having the problem.

    Daryl

    ---
    * Synchronet * The Thunderbolt BBS - wx1der.dyndns.org
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From KK4QBN@1:103/705 to Digital Man on Thu Jan 4 19:29:50 2018
    Re: SyncWx Issue
    By: Digital Man to Nightfox on Wed Jan 03 2018 21:27:05

    JSON.parse

    I noticed that on my BBS as well.

    It's working here. I assume the web-site where it pulls its data must be down or returning something unexpeced. Hopefully it corrects itself.

    I agree, Its working fine for me.. and has been for a good while. but I was receiving this and another error a good many months back and I believe it was actually an issue with wxunderground. it cleared itself up in a couple days.

    another issue I was having is with my crappy router not allowing data to get to wxunderground to get the correct zip or airport code ?? been a while.. so I had to change some code in the script itself to work around, thanks to Ken it was very easy.

    --

    Tim Smith (KK4QBN)
    KK4QBN BBS

    ---
    * Synchronet * KK4QBN BBS - kk4qbn.com - kk4qbn.synchro.net - Chatsworth GA USA
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)