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

Missing credentials for scraper. CompanyId: hapoalim #268

Merged

Conversation

baruchiro
Copy link
Collaborator

fix #257

Comment on lines -27 to -29
if (!credentials || (!credentials.username && !credentials.num && !credentials.id) || !credentials.password) {
throw new Error(`Missing credentials for scraper. CompanyId: ${companyId}`);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed this. This is a complicated condition and its maintaining worth more than its value.

Copy link

Choose a reason for hiding this comment

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

suggesting to place the validation logic(s) at the input forms

Copy link
Owner

Choose a reason for hiding this comment

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

This validation was added because before we had it, the error in this case was cryptic.

You want to remove it because it fails too often in cases where there are credentials that are valid?

If this is the case, I suggest replacing the exception with a console

Copy link
Owner

Choose a reason for hiding this comment

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

suggesting to place the validation logic(s) at the input forms

That's a good idea. Doesn't have to block this PR.

Its actually a good first issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You want to remove it because it fails too often in cases where there are credentials that are valid?

If this is the case, I suggest replacing the exception with a console

My point is it failed because of a bug in the code, and it is not so important to fail it earlier before the scraping.
I think it is very complicated logic for an almost useless use case. It is complicated because you need to validate the loginFields that differ in each scrapper.

suggesting to place the validation logic(s) at the input forms

And in any way, you can't insert an empty field through the UI.

Comment on lines -27 to -29
if (!credentials || (!credentials.username && !credentials.num && !credentials.id) || !credentials.password) {
throw new Error(`Missing credentials for scraper. CompanyId: ${companyId}`);
}
Copy link
Owner

Choose a reason for hiding this comment

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

This validation was added because before we had it, the error in this case was cryptic.

You want to remove it because it fails too often in cases where there are credentials that are valid?

If this is the case, I suggest replacing the exception with a console

@baruchiro baruchiro merged commit 35fce4a into master Jun 22, 2021
@baruchiro baruchiro deleted the baruchiro/Missing-credentials-for-scraper-CompanyId-hapoalim branch June 22, 2021 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing credentials for scraper. CompanyId: hapoalim
3 participants