veilidchat/lib/tools/stack_trace.dart

13 lines
443 B
Dart
Raw Normal View History

2023-12-26 20:26:54 -05:00
import 'package:stack_trace/stack_trace.dart';
/// Rethrows [error] with a stacktrace that is the combination of [stackTrace]
/// and [StackTrace.current].
Never throwErrorWithCombinedStackTrace(Object error, StackTrace stackTrace) {
final chain = Chain([
Trace.current(),
...Chain.forTrace(stackTrace).traces,
2024-01-31 22:29:06 -05:00
]); // .foldFrames((frame) => frame.package == 'xxx');
2023-12-26 20:26:54 -05:00
Error.throwWithStackTrace(error, chain.toTrace().vmTrace);
}