mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2024-10-01 06:55:46 -04:00
13 lines
443 B
Dart
13 lines
443 B
Dart
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,
|
|
]); // .foldFrames((frame) => frame.package == 'xxx');
|
|
|
|
Error.throwWithStackTrace(error, chain.toTrace().vmTrace);
|
|
}
|