Conditions | 4 |
Paths | 15 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function handle() |
||
27 | { |
||
28 | /** @var Reporter $honeybadger */ |
||
29 | $honeybadger = app('honeybadger.loud'); |
||
30 | |||
31 | try { |
||
32 | if (! config('honeybadger.report_data')) { |
||
33 | $this->info("You have `report_data` set to false in your config. Errors won't be reported in this environment."); |
||
34 | $this->info("We've switched it to true for this test, but you should check that it's enabled for your production environments."); |
||
35 | } |
||
36 | $result = $honeybadger->notify(new TestException); |
||
37 | $id = $result['id'] ?? null; |
||
38 | if (is_null($id)) { |
||
39 | throw new Exception('There was an error sending the exception to Honeybadger'); |
||
40 | } |
||
41 | |||
42 | $noticeUrl = "https://app.honeybadger.io/notice/$id"; |
||
43 | $this->info("Successfully sent a test exception to Honeybadger: $noticeUrl"); |
||
44 | } catch (Exception $e) { |
||
45 | $this->error($e->getMessage()); |
||
46 | } |
||
49 |