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 8
8
use Kiboko \Component \Bucket \RejectionResultBucket ;
9
9
use Kiboko \Contract \Bucket \ResultBucketInterface ;
10
10
use Kiboko \Contract \Pipeline \ExtractorInterface ;
11
+ use Psr \Http \Client \NetworkExceptionInterface ;
11
12
12
13
final class CustomerExtractor implements ExtractorInterface
13
14
{
@@ -62,8 +63,15 @@ public function extract(): iterable
62
63
63
64
yield $ this ->processResponse ($ response );
64
65
}
65
- } catch (\ Exception $ exception ) {
66
+ } catch (NetworkExceptionInterface $ exception ) {
66
67
$ 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 ]);
67
75
}
68
76
}
69
77
Original file line number Diff line number Diff line change 8
8
use Kiboko \Component \Bucket \RejectionResultBucket ;
9
9
use Kiboko \Contract \Bucket \ResultBucketInterface ;
10
10
use Kiboko \Contract \Pipeline \ExtractorInterface ;
11
+ use Psr \Http \Client \NetworkExceptionInterface ;
11
12
12
13
final class InvoiceExtractor implements ExtractorInterface
13
14
{
@@ -62,8 +63,15 @@ public function extract(): iterable
62
63
63
64
yield $ this ->processResponse ($ response );
64
65
}
65
- } catch (\ Exception $ exception ) {
66
+ } catch (NetworkExceptionInterface $ exception ) {
66
67
$ 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 ]);
67
75
}
68
76
}
69
77
Original file line number Diff line number Diff line change 8
8
use Kiboko \Component \Bucket \RejectionResultBucket ;
9
9
use Kiboko \Contract \Bucket \ResultBucketInterface ;
10
10
use Kiboko \Contract \Pipeline \ExtractorInterface ;
11
+ use Psr \Http \Client \NetworkExceptionInterface ;
11
12
12
13
final class OrderExtractor implements ExtractorInterface
13
14
{
@@ -62,8 +63,15 @@ public function extract(): iterable
62
63
63
64
yield $ this ->processResponse ($ response );
64
65
}
65
- } catch (\ Exception $ exception ) {
66
+ } catch (NetworkExceptionInterface $ exception ) {
66
67
$ 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 ]);
67
75
}
68
76
}
69
77
Original file line number Diff line number Diff line change 8
8
use Kiboko \Component \Bucket \RejectionResultBucket ;
9
9
use Kiboko \Contract \Bucket \ResultBucketInterface ;
10
10
use Kiboko \Contract \Pipeline \ExtractorInterface ;
11
+ use Psr \Http \Client \NetworkExceptionInterface ;
11
12
12
13
final class ProductExtractor implements ExtractorInterface
13
14
{
@@ -62,8 +63,15 @@ public function extract(): iterable
62
63
63
64
yield $ this ->processResponse ($ response );
64
65
}
65
- } catch (\ Exception $ exception ) {
66
+ } catch (NetworkExceptionInterface $ exception ) {
66
67
$ 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 ]);
67
75
}
68
76
}
69
77
You can’t perform that action at this time.
0 commit comments