File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
lib/internal/Magento/Framework/Exception Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+
7+ namespace Magento \Framework \Exception ;
8+
9+ use Magento \Framework \Phrase ;
10+
11+ /**
12+ * Exception thrown while processing bulk of entities
13+ *
14+ * @api
15+ */
16+ class BulkException extends AbstractAggregateException
17+ {
18+ /**
19+ * @var array
20+ */
21+ private $ data ;
22+
23+ /**
24+ * Exception thrown while processing bulk of entities
25+ *
26+ * It is capable of holding both successfully processed entities and failed entities.
27+ * Client can decide how to handle the information
28+ *
29+ * @param \Magento\Framework\Phrase $phrase
30+ * @param \Exception $cause
31+ * @param int $code
32+ */
33+ public function __construct (Phrase $ phrase = null , \Exception $ cause = null , $ code = 0 )
34+ {
35+ if ($ phrase === null ) {
36+ $ phrase = new Phrase ('One or more input exceptions have occurred while processing bulk. ' );
37+ }
38+ parent ::__construct ($ phrase , $ cause , $ code );
39+ }
40+
41+ /**
42+ * @param $data array
43+ */
44+ public function addData ($ data )
45+ {
46+ $ this ->data = $ data ;
47+ }
48+
49+ /**
50+ * @return array
51+ */
52+ public function getData ()
53+ {
54+ return $ this ->data ;
55+ }
56+ }
You can’t perform that action at this time.
0 commit comments