File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
app/code/Magento/NewRelicReporting Expand file tree Collapse file tree 2 files changed +45
-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
+ namespace Magento \NewRelicReporting \Plugin ;
7
+
8
+ use Magento \Framework \App \Http ;
9
+ use Magento \NewRelicReporting \Model \Config ;
10
+ use Magento \NewRelicReporting \Model \NewRelicWrapper ;
11
+
12
+ class HttpPlugin
13
+ {
14
+ /**
15
+ * @var Config
16
+ */
17
+ protected $ config ;
18
+
19
+ /**
20
+ * @var NewRelicWrapper
21
+ */
22
+ protected $ newRelicWrapper ;
23
+
24
+ /**
25
+ * @param Config $config
26
+ * @param NewRelicWrapper $newRelicWrapper
27
+ */
28
+ public function __construct (
29
+ Config $ config ,
30
+ NewRelicWrapper $ newRelicWrapper
31
+ ) {
32
+ $ this ->config = $ config ;
33
+ $ this ->newRelicWrapper = $ newRelicWrapper ;
34
+ }
35
+
36
+ public function beforeCatchException (Http $ subject , $ bootstrap , $ exception )
37
+ {
38
+ if ($ this ->config ->isNewRelicEnabled ()) {
39
+ $ this ->newRelicWrapper ->reportError ($ exception );
40
+ }
41
+ }
42
+ }
Original file line number Diff line number Diff line change 27
27
</argument >
28
28
</arguments >
29
29
</type >
30
+ <type name =" Magento\Framework\App\Http" >
31
+ <plugin name =" framework-http-newrelic" type =" Magento\NewRelicReporting\Plugin\HttpPlugin" />
32
+ </type >
30
33
</config >
You can’t perform that action at this time.
0 commit comments