From 7b1b997c72f2008640a05bf778ade267e2fd3f38 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 7 Mar 2023 13:44:27 -0800 Subject: [PATCH] include backtrace in page --- web3_proxy/src/pagerduty.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web3_proxy/src/pagerduty.rs b/web3_proxy/src/pagerduty.rs index 8716df90..39b0a3be 100644 --- a/web3_proxy/src/pagerduty.rs +++ b/web3_proxy/src/pagerduty.rs @@ -4,6 +4,7 @@ use log::{debug, error}; use pagerduty_rs::eventsv2sync::EventsV2 as PagerdutySyncEventsV2; use pagerduty_rs::types::{AlertTrigger, AlertTriggerPayload, Event}; use serde::Serialize; +use std::backtrace::Backtrace; use std::{ collections::hash_map::DefaultHasher, hash::{Hash, Hasher}, @@ -71,7 +72,9 @@ pub fn panic_handler( ) { let summary = format!("{}", panic_info); - let details = format!("{:#?}", panic_info); + let backtrace = Backtrace::force_capture(); + + let details = format!("{:#?}\n{:#?}", panic_info, backtrace); if summary.starts_with("panicked at 'WS Server panic") { // the ethers-rs library panics when websockets disconnect. this isn't a panic we care about reporting