Skip to content

Series import: IllegalArgumentException when only price and currency were extracted #1218

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

Open
php-coder opened this issue Jan 15, 2020 · 3 comments
Assignees
Milestone

Comments

@php-coder
Copy link
Owner

Series import fails when only price/currency were extracted.

Log:

2020-01-15 22:30:34.676 [user:1 ] INFO 61320 --- [qtp307894016-20] r.m.w.f.s.i.SeriesImportServiceImpl : Request # 1: page were parsed (AddSeriesParsedDataDbDto(...), SeriesSalesParsedDataDbDto(sellerId=null, sellerGroupId=null, sellerName=null, sellerUrl=null, price=660.00, currency=RUB))

Exception:

...
Caused by: java.lang.IllegalArgumentException: Seller id must be non null
	at org.apache.commons.lang3.Validate.isTrue(Validate.java:158) ~[commons-lang3-3.8.jar:3.8]
	at ru.mystamps.web.feature.series.sale.SeriesSalesServiceImpl.add(SeriesSalesServiceImpl.java:40) ~[classes/:na]
...
@php-coder php-coder added this to the 0.4.3 milestone Jan 15, 2020
@php-coder php-coder self-assigned this Jan 15, 2020
@php-coder php-coder changed the title Series import: IllegalArgumentException when only price with currency were extracted Series import: IllegalArgumentException when only price and currency were extracted Jan 15, 2020
@php-coder
Copy link
Owner Author

It seems like this happens because 1) seller-related fields weren't shown while they should (#1232) and 2) we don't have validation here that prevents this on controller-level (#859)

@php-coder
Copy link
Owner Author

After fixing #1232 it's hard or nearly impossible to reproduce this issue: the fields for name/url are shown on the page and after form submission they have empty values. Because of that, a participant is created (yes, with empty name, url) and hence sellerId isn't null now.

But after fixing #851 and #854 it should become reproducible again.

@php-coder
Copy link
Owner Author

But after fixing #851 and #854 it should become reproducible again.

The exception is different this time:

Caused by: java.lang.IllegalArgumentException: Name must be non null
	at org.apache.commons.lang3.Validate.isTrue(Validate.java:158) ~[commons-lang3-3.8.jar:3.8]
	at ru.mystamps.web.feature.participant.ParticipantServiceImpl.add(ParticipantServiceImpl.java:42) ~[classes/:na]

@php-coder php-coder modified the milestones: 0.4.3, 0.4.4 Mar 17, 2020
@php-coder php-coder modified the milestones: 0.4.4, next May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant