4

Linking to Flare errors on your error page

 3 years ago
source link: https://flareapp.io/blog/35-linking-to-flare-errors-on-your-error-page
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Linking to Flare errors on your error page

Monday 13th of September 2021

We've launched a new feature that will make it easier for users of your app to report specific errors.

When an error occurs in a web request, Laravel will show this error page by default.

screenshot

If a user sees this page and wants to report this error to you, the user usually only reports the URL and the time the error was seen.

To let your users pinpoint the exact error they saw, you can display the UUID of the error sent to Flare.

If you haven't already done so, you can publish Laravel's default error pages with this command.

php artisan vendor:publish --tag=laravel-errors

Typically, you would alter the resources/views/errors/500.blade.php to display the UUID and optionally a URL of the latest error sent to Flare.

@extends('errors::minimal')

@section('title', __('Server Error'))
@section('code', '500')
@section('message')
    Server error
   <div>
       <a href="{{ Flare::sentReports()->latestUrl() }}">
           {{ Flare::sentReports()->latestUuid() }}
       </a>
   </div>
@endsection

This is how that would look like in the browser.

screenshot

That link returned by Flare::sentReports()->latestUrl() isn't publicly accessible, the page is only visible to Flare users that have access to the project on Flare.

In certain cases, multiple errors can be reported to Flare in a single request. To get a hold of the UUIDs of all sent errors, you can call Flare::sentReports()->uuids(). You can get links to all sent errors with Flare::sentReports()->urls().

We hope that you like this nice new feature.

Track your errors in 3 simple steps:

1 Create an account
2 Add your project
3 Install an application key

Start your 10-day free trial

This takes only a few seconds


Back to list


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK