File tree Expand file tree Collapse file tree 4 files changed +99
-4
lines changed Expand file tree Collapse file tree 4 files changed +99
-4
lines changed Original file line number Diff line number Diff line change 1111|
1212*/
1313
14- Route:: get ( ' / ' , function ()
14+ function verifyCredentials ()
1515{
16+ Log::info ('Verifying credentials ' );
17+ throw new Exception ('No credentials passed! ' );
18+ }
19+
20+
21+ function authenticateUser ()
22+ {
23+ Log::info ('Authenticating the current user ' );
24+ verifyCredentials ();
25+ }
26+
27+
28+ Route::get ('/ ' , function () {
1629 Log::info ('Rendering a page thats about to error ' );
17- throw new Exception ( ' An unhandled exception ' );
30+ authenticateUser ( );
1831});
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ public function report(Exception $e)
4848 */
4949 public function render ($ request , Exception $ e )
5050 {
51- return parent ::render ($ request , $ e );
51+ // return parent::render($request, $e);
52+ return response ()->view ('errors.500 ' , [
53+ 'sentryID ' => app ('sentry ' )->getLastEventID (),
54+ ], 500 );
5255 }
5356}
Original file line number Diff line number Diff line change 1111|
1212*/
1313
14+ function verifyCredentials ()
15+ {
16+ Log::info ('Verifying credentials ' );
17+ throw new Exception ('No credentials passed! ' );
18+ }
19+
20+
21+ function authenticateUser ()
22+ {
23+ Log::info ('Authenticating the current user ' );
24+ verifyCredentials ();
25+ }
26+
27+
1428Route::get ('/ ' , function () {
1529 Log::info ('Rendering a page thats about to error ' );
16- throw new Exception ( ' An unhandled exception ' );
30+ authenticateUser ( );
1731});
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ <html >
3+ <head >
4+ <title >Internal Server Error</title >
5+
6+ <link href =" https://fonts.googleapis.com/css?family=Lato:100" rel =" stylesheet" type =" text/css" >
7+
8+ <style >
9+ html , body {
10+ height : 100% ;
11+ }
12+
13+ body {
14+ margin : 0 ;
15+ padding : 0 ;
16+ width : 100% ;
17+ color : #B0BEC5 ;
18+ display : table ;
19+ font-weight : 100 ;
20+ font-family : ' Lato' ;
21+ }
22+
23+ .container {
24+ text-align : center ;
25+ display : table-cell ;
26+ vertical-align : middle ;
27+ }
28+
29+ .content {
30+ text-align : center ;
31+ display : inline-block ;
32+ }
33+
34+ .title {
35+ font-size : 72px ;
36+ margin-bottom : 40px ;
37+ }
38+ </style >
39+ </head >
40+ <body >
41+ <div class =" container" >
42+ <div class =" content" >
43+ <div class =" title" >Something went wrong.</div >
44+ @unless (empty ($sentryID ) )
45+ <!-- Sentry JS SDK 2.1.+ required -->
46+ <script src =" https://cdn.ravenjs.com/3.3.0/raven.min.js" ></script >
47+
48+ <script >
49+ Raven .showReportDialog ({
50+ eventId: ' {{ $sentryID } }' ,
51+
52+ // use the public DSN (dont include your secret!)
53+ dsn: ' https://[email protected] /3235' , 54+
55+ user: {
56+ ' name' : ' Jane Doe' ,
57+ 58+ }
59+ });
60+ </script >
61+ @endunless
62+ </div >
63+ </div >
64+ </body >
65+ </html >
You can’t perform that action at this time.
0 commit comments