You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We uses batches quite a bit - mostly for importing large spreadsheets. We usually allowFailures() and use some sort of redis store to record any errors which are then sent to the user in the finally() block.
But it's a bit of a faff to write each time and to test.
So I was thinking of adding an error bag to the batch so you could do something like $this->batch->addError('rows', 'Row 1234 missing shipped date (column F)') and then be able to pull those out in the finally/then/whatever callback. Also allowing the testing possibility of something like $this->assertBatchHasErrors('rows', 'Row 1234 missing.....').
Just not sure if I'm the only one having to do this by hand all the time.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
We uses batches quite a bit - mostly for importing large spreadsheets. We usually
allowFailures()
and use some sort of redis store to record any errors which are then sent to the user in thefinally()
block.But it's a bit of a faff to write each time and to test.
So I was thinking of adding an error bag to the batch so you could do something like
$this->batch->addError('rows', 'Row 1234 missing shipped date (column F)')
and then be able to pull those out in the finally/then/whatever callback. Also allowing the testing possibility of something like$this->assertBatchHasErrors('rows', 'Row 1234 missing.....')
.Just not sure if I'm the only one having to do this by hand all the time.
Beta Was this translation helpful? Give feedback.
All reactions