Skip to content
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

[PresidenciaPTBridge]: Support multiple sections #2082

Merged
merged 3 commits into from
May 9, 2021

Conversation

somini
Copy link
Contributor

@somini somini commented Apr 22, 2021

These sections can all be selected in parallel. There's only 4, those
requests are relatively quick.

This also adds a favicon.

somini added 2 commits April 22, 2021 01:30
These sections can all be selected in parallel. There's only 4, those
requests are relatively quick.

This also adds a favicon.
Debug::log('Key: ' . var_export($k, true));
if($this->getInput($k)) {
$html = getSimpleHTMLDOMCached($this->getURI() . $k)
or returnServerError('Could not load content');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recently realised that combination like getContents() or returnServerError() does not execute second statement if error happens. Only if returned body is empty. Is that statement for empty body check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it's to detect any error, just like in most other bridges.

Does that mean that is redundant, that errors on the request just fail the entire thing? Or do we need some extra code for that? Should that be done on the common bridge class?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean that is redundant, that errors on the request just fail the entire thing?

Yes. If server returns non-200 result code, exception will be raised. For me this is correct behavior, including your case.

If you need to handle errored responses, you can wrap to try catch, but in this case "Could not load content" seem to be less informative that "Error %HTTP_CODE%, Unexpected response from upstream". Like here: https://feed.eugenemolotov.ru/?action=display&bridge=Vk&u=idasfsafasf1&format=Html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, I'll change this PR later. I'll consider this in the future.

@em92 em92 mentioned this pull request May 6, 2021
@em92 em92 merged commit e79a02a into RSS-Bridge:master May 9, 2021
@em92
Copy link
Contributor

em92 commented May 9, 2021

gj!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants