New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle caaqm loading error #561
Comments
I missed this issue. I'll take a look tomorrow, but I guess, there's just a need for some simple |
@jflasher, the issue here is the error not forwarded between
The errors on the returned |
@jflasher what do you think about something like this:
The |
@MichalCz I know this isn't exactly the same, but I like the way that For the temporary fix, I had to use the following to get the code to run
but even with this, when I put in an invalid url to test I was seeing an error message like below which seems like it's not being nicely caught? As I write this, I realize we also need to nicely handle the case where invalid JSON is passed to the parser. I tried that as well and it looks like it's crashing rather than catching it?
|
Hmm... I'll try to run this tomorrow evening and check. There is an option
to put a try/catch around the error and this should work, but it should do
the same with the function (as the function is internally surrounded with
try/catch).
One thing I do know: running a single source will throw the error and
result in non-zero exit code (brilliantly engineered, lousily documented -
sorry). If you run this with all the other adapters it wont crash, but it
will still fall the whole adapter, which ain't nice.
But I'll also check tomorrow, as I said.
M.
|
@jflasher I'm looking at a couple of changes to prove my point. I'm currently getting the error caught, but it causes the whole process to hang - it will get all the data except our current adapter, but it would fail while it should handle the situation. I'll have to spend some time tomorrow, I'll let you know my findings and probably I'll create a pull request. |
Thanks! |
Hi Joe, Please see my commit here: signicode/openaq-fetch commit: 3c471a13 It's working - meaning if you change the url of the link, it'll forward the error, but I still cannot get round the fact that the stream doesn't end and hangs there. I need to spend some quiet and focused hours on this and checking how such request should actually work. The soonest I'll find a bulk of time is weekend, so until then if you tried to add |
@MichalCz I looked it over for a bit, but I'm afraid I am not going to be much help here. Relatedly, while running some tests, I saw a crash due to the eea-direct adapter URL not being found. I'm sure it was just a transient error, but I guess this is probably an issue we'll see with any of the |
Yes. It may be that.
The function wrapping solution fixes the issue (there won't be a crash),
but I need to investigate the actual reasons for not finishing the streams.
I'm adding the pipeline method which will make the code look better, so
I'll provide a fix for all the affected adapters with it.
--
Signicode
|
@jflasher a new version of scramjet with a new I'm playing around the caaqm adapter a bit and will check all 6 adapters I rewritten for similar improvement and create a push request. It should be ready by tomorrow evening CET. |
Awesome, thanks! |
Good morning @jflasher Please see if this is a sufficient solution. :) |
Should be closed with #573 |
@MichalCz would you be able to tell me how best to handle a loading error at https://github.com/openaq/openaq-fetch/blob/develop/adapters/caaqm.js#L39? I see we have one later for the individual stations, but right now fetch is crashing when doing this initial load (and page is unavailable). I've disabled the source for now.
Thanks!
The text was updated successfully, but these errors were encountered: