Blog
Every exception has a backstory: introducing previous exceptions in Flare
Here at Flare we love building the best error tracker there is. One of the things nagging me personally for years is that we didn't support previous exceptions.
When you create an exception in PHP, you can pass along the one that caused it:
try {
$this->importProduct($product);
} catch (Throwable $exception) {
throw new ProductImportFailed(
"Could not import product {$product->sku}",
previous: $exception,
);
}
This lets you catch a low level exception and rethrow it with your own context. Laravel famously does the same thing, wrapping a PDOException in its own QueryException with some extra info about the query that just failed.
Up until now, Flare completely ignored these previous exceptions. And often that's fine, since the wrapping exception usually carries more useful information.
But here's the thing. When you wrap an exception, the stack trace you end up looking at starts at your catch block:
App\Import\ProductImportFailed
Could not import product SKU-4471
#0 app/Import/ImportProducts.php:19
#1 app/Jobs/ImportFeedJob.php:24
#2 vendor/laravel/framework/src/.../CallQueuedHandler.php:47
You know which product broke. You have no idea why.
Every frame that led to the actual failure lives on the previous exception:
TypeError
Money::__construct(): Argument #1 ($amount) must be of type int, string given
#0 app/Support/Money.php:31
#1 app/Import/ProductTransformer.php:58
#2 app/Import/ProductImporter.php:24
There it is. The feed started sending prices as strings.
That's why, starting from version 3.4 of our PHP and Laravel packages, we collect the whole chain and Flare displays it. The arrow next to the exception class lets you navigate between them, and the message and stack trace follow along:

Previous exceptions are an essential part of errors and we're really happy Flare finally supports them.
We're working a lot on Flare these days. Performance monitoring for JavaScript has been added, connecting an MCP client to Flare is now a lot easier thanks to OAuth, and the Flare clients have been backported to older PHP and Laravel versions.
Anything you're missing in Flare? Let us know at [email protected].
Happy debugging!
Continue reading
Automatic breadcrumbs recording and GDPR consent
The latest JavaScript client can record breadcrumbs for you: the clicks, navigations, and HTTP requests a user made before an error, so you can retrace their steps. We also added a consent hook, so nothing is sent to Flare until a visitor accepts your cookie or GDPR banner.
Dries
Announcing performance monitoring for JavaScript applications
Until now, performance monitoring in Flare was a Laravel and PHP feature. Today we are releasing it for your JavaScript applications too. Monitor page loads, measure Core Web Vitals and profile your React, Svelte or Vue components.
Dries
Subscribe to Backtrace, our quarterly Flare newsletter
No spam, just news & product updates