Exception List
The exception page lists all the unique exceptions that have been observed in your application, showing the total count and users affected.Uniqueness of exceptions is determined by the combination of their class,
code, and the file and line number where they were thrown or reported. This
means that if an exception is thrown in the same file and line number, but
with a different message, it will be considered as a different exception.
Exception Details
When you click an exception in the list, Nightwatch opens the exception details view. This page gives you everything you need to understand the scope and impact of the error at a glance. Nightwatch shows when the exception was first and most recently seen, along with the total number of occurences and users affected across the last 30 days, 7 days, and 24 hours. Where Source Code Capture is enabled you will see the stack trace includes inlined source code, highlighting the exact line where the exception was triggered. The details page also provides a list of individual occurrences of the exception related to their parent context (such as a request, job, or command). Selecting any occurrence opens the full trace view, allowing you to follow the path that led to the exception and debug in detail.Auto-generating issues
Nightwatch automatically creates a new issue for each unhandled exception that is reported, and will associate any new occurrences of the same exception with the existing issue, so that you can track the issue and resolve it systematically.Configuration
Source Code Capture
Nightwatch will automatically augment the stack trace with the relevant source code where possible. You can disable this behavior by setting theNIGHTWATCH_CAPTURE_EXCEPTION_SOURCE_CODE environment variable to false.
Sampling
Default Behavior
By default, Nightwatch captures all exceptions from all requests and commands to ensure that you have the full context of any exception that occurs in your application. For example, if you set the request sample rate to 10% and the exception sample rate to 100% (default), Nightwatch will capture any request that throws an exception, regardless of whether the request would have been sampled otherwise.Exception Sampling Rate
To ignore exceptions on non-sampled requests, setNIGHTWATCH_EXCEPTION_SAMPLE_RATE=0. This setting ensures that exceptions are captured only from sampled requests.
Exception Throttling
Laravel provides additional ways to throttle exception reporting for high traffic applications or when you need to protect against sudden spikes. https://laravel.com/docs/errors#throttling-reported-exceptionsFiltering
There are no specific filtering methods for exceptions. Exceptions are captured based on the sampling configuration described above.Redaction
You can manually redact sensitive information from exception messages using theredactExceptions callback:
Manually Reporting Exceptions
Nightwatch automatically listens to all exceptions reported within your Laravel application:📘 This is only needed in rare cases where exceptions are not captured automatically.
Unrecoverable Exceptions
If Nightwatch experiences an unrecoverable exception when recording events from your application, it can become unable to notify you of the issue. You may register a handler for these scenarios with theNightwatch::handleUnrecoverableExceptionsUsing method. You should put this in your AppServiceProvider::register method:
AppServiceProvider.php