Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions examples/laravel-4.2/app/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,21 @@
|
*/

Route::get('/', function()
function verifyCredentials()
{
Log::info('Verifying credentials');
throw new Exception('No credentials passed!');
}


function authenticateUser()
{
Log::info('Authenticating the current user');
verifyCredentials();
}


Route::get('/', function () {
Log::info('Rendering a page thats about to error');
throw new Exception('An unhandled exception');
authenticateUser();
});
5 changes: 4 additions & 1 deletion examples/laravel-5.2/app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public function report(Exception $e)
*/
public function render($request, Exception $e)
{
return parent::render($request, $e);
// return parent::render($request, $e);
return response()->view('errors.500', [
'sentryID' => app('sentry')->getLastEventID(),
], 500);
}
}
16 changes: 15 additions & 1 deletion examples/laravel-5.2/app/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@
|
*/

function verifyCredentials()
{
Log::info('Verifying credentials');
throw new Exception('No credentials passed!');
}


function authenticateUser()
{
Log::info('Authenticating the current user');
verifyCredentials();
}


Route::get('/', function () {
Log::info('Rendering a page thats about to error');
throw new Exception('An unhandled exception');
authenticateUser();
});
65 changes: 65 additions & 0 deletions examples/laravel-5.2/resources/views/errors/500.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<title>Internal Server Error</title>

<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">

<style>
html, body {
height: 100%;
}

body {
margin: 0;
padding: 0;
width: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}

.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}

.content {
text-align: center;
display: inline-block;
}

.title {
font-size: 72px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Something went wrong.</div>
@unless(empty($sentryID))
<!-- Sentry JS SDK 2.1.+ required -->
<script src="https://cdn.ravenjs.com/3.3.0/raven.min.js"></script>

<script>
Raven.showReportDialog({
eventId: '{{ $sentryID }}',

// use the public DSN (dont include your secret!)
dsn: 'https://e9ebbd88548a441288393c457ec90441@app.getsentry.com/3235',

user: {
'name': 'Jane Doe',
'email': 'jane.doe@example.com',
}
});
</script>
@endunless
</div>
</div>
</body>
</html>