File tree Expand file tree Collapse file tree 4 files changed +36
-4
lines changed
Expand file tree Collapse file tree 4 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 88use Kiboko \Component \Bucket \RejectionResultBucket ;
99use Kiboko \Contract \Bucket \ResultBucketInterface ;
1010use Kiboko \Contract \Pipeline \ExtractorInterface ;
11+ use Psr \Http \Client \NetworkExceptionInterface ;
1112
1213final class CustomerExtractor implements ExtractorInterface
1314{
@@ -62,8 +63,15 @@ public function extract(): iterable
6263
6364 yield $ this ->processResponse ($ response );
6465 }
65- } catch (\ Exception $ exception ) {
66+ } catch (NetworkExceptionInterface $ exception ) {
6667 $ this ->logger ->alert ($ exception ->getMessage (), ['exception ' => $ exception ]);
68+ yield new RejectionResultBucket ([
69+ 'path ' => 'customer ' ,
70+ 'method ' => 'get ' ,
71+ 'queryParameters ' => $ this ->compileQueryParameters (),
72+ ]);
73+ } catch (\Exception $ exception ) {
74+ $ this ->logger ->critical ($ exception ->getMessage (), ['exception ' => $ exception ]);
6775 }
6876 }
6977
Original file line number Diff line number Diff line change 88use Kiboko \Component \Bucket \RejectionResultBucket ;
99use Kiboko \Contract \Bucket \ResultBucketInterface ;
1010use Kiboko \Contract \Pipeline \ExtractorInterface ;
11+ use Psr \Http \Client \NetworkExceptionInterface ;
1112
1213final class InvoiceExtractor implements ExtractorInterface
1314{
@@ -62,8 +63,15 @@ public function extract(): iterable
6263
6364 yield $ this ->processResponse ($ response );
6465 }
65- } catch (\ Exception $ exception ) {
66+ } catch (NetworkExceptionInterface $ exception ) {
6667 $ this ->logger ->alert ($ exception ->getMessage (), ['exception ' => $ exception ]);
68+ yield new RejectionResultBucket ([
69+ 'path ' => 'invoice ' ,
70+ 'method ' => 'get ' ,
71+ 'queryParameters ' => $ this ->compileQueryParameters (),
72+ ]);
73+ } catch (\Exception $ exception ) {
74+ $ this ->logger ->critical ($ exception ->getMessage (), ['exception ' => $ exception ]);
6775 }
6876 }
6977
Original file line number Diff line number Diff line change 88use Kiboko \Component \Bucket \RejectionResultBucket ;
99use Kiboko \Contract \Bucket \ResultBucketInterface ;
1010use Kiboko \Contract \Pipeline \ExtractorInterface ;
11+ use Psr \Http \Client \NetworkExceptionInterface ;
1112
1213final class OrderExtractor implements ExtractorInterface
1314{
@@ -62,8 +63,15 @@ public function extract(): iterable
6263
6364 yield $ this ->processResponse ($ response );
6465 }
65- } catch (\ Exception $ exception ) {
66+ } catch (NetworkExceptionInterface $ exception ) {
6667 $ this ->logger ->alert ($ exception ->getMessage (), ['exception ' => $ exception ]);
68+ yield new RejectionResultBucket ([
69+ 'path ' => 'order ' ,
70+ 'method ' => 'get ' ,
71+ 'queryParameters ' => $ this ->compileQueryParameters (),
72+ ]);
73+ } catch (\Exception $ exception ) {
74+ $ this ->logger ->critical ($ exception ->getMessage (), ['exception ' => $ exception ]);
6775 }
6876 }
6977
Original file line number Diff line number Diff line change 88use Kiboko \Component \Bucket \RejectionResultBucket ;
99use Kiboko \Contract \Bucket \ResultBucketInterface ;
1010use Kiboko \Contract \Pipeline \ExtractorInterface ;
11+ use Psr \Http \Client \NetworkExceptionInterface ;
1112
1213final class ProductExtractor implements ExtractorInterface
1314{
@@ -62,8 +63,15 @@ public function extract(): iterable
6263
6364 yield $ this ->processResponse ($ response );
6465 }
65- } catch (\ Exception $ exception ) {
66+ } catch (NetworkExceptionInterface $ exception ) {
6667 $ this ->logger ->alert ($ exception ->getMessage (), ['exception ' => $ exception ]);
68+ yield new RejectionResultBucket ([
69+ 'path ' => 'product ' ,
70+ 'method ' => 'get ' ,
71+ 'queryParameters ' => $ this ->compileQueryParameters (),
72+ ]);
73+ } catch (\Exception $ exception ) {
74+ $ this ->logger ->critical ($ exception ->getMessage (), ['exception ' => $ exception ]);
6775 }
6876 }
6977
You can’t perform that action at this time.
0 commit comments