Important: Buglesstack is in beta development. You can be one of our first users!

Hi, I'm Ivan 👋

For any questions or inquiries, you can write to me at ivan@buglesstack.com

Implementation Guide

Wrap your Puppeteer code in a try/catch block and send error data to Buglesstack:

// .. assuming you already have your Puppeteer browser and page initialized

try {
	await page.goto('https://www.google.com/search?q=puppeteer');		
	await page.waitForSelector('[name="q"]');
}
catch (error) {
	// Prepare buglesstack data
	const buglesstackData = {
		url: page.url(),
		screenshot: await page.screenshot({ encoding: 'base64' }),
		html: await page.content(),
		metadata: {},
		message: error.message,
		stack: error.stack
	};

	// Get your access token from https://app.buglesstack.com
	const ACCESS_TOKEN = 'HERE_YOUR_ACCESS_TOKEN';

	// Send error to buglesstack
	await axios.post('https://app.buglesstack.com/api/v1/crashes', buglesstackData, {
		headers: {
			Authorization: `Bearer ${ACCESS_TOKEN}`,
			'Content-Type': 'application/json'
		}
	});
		
	// Re-throw the error to propagate it
	throw error;
}

How it works:

  1. Wrap your Puppeteer operations in a try/catch block
  2. When an error occurs, capture relevant data (URL, screenshot, HTML)
  3. Send the error data to Buglesstack's API
  4. Re-throw the error to maintain your application's error flow