File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ import 'package:sane/src/exceptions.dart';
22import 'package:sane/src/isolate_messages/interface.dart' ;
33
44class ExceptionResponse implements IsolateResponse {
5- ExceptionResponse ({required this .exception});
5+ ExceptionResponse ({
6+ required this .exception,
7+ required this .stackTrace,
8+ });
69
710 final SaneException exception;
11+ final StackTrace stackTrace;
812}
Original file line number Diff line number Diff line change @@ -59,7 +59,10 @@ class SaneIsolate implements Sane {
5959 replyPort.close ();
6060
6161 if (response is ExceptionResponse ) {
62- throw response.exception;
62+ Error .throwWithStackTrace (
63+ response.exception,
64+ response.stackTrace,
65+ );
6366 }
6467
6568 return response;
@@ -308,8 +311,11 @@ void _isolateEntryPoint(_IsolateEntryPointArgs args) {
308311 late IsolateResponse response;
309312 try {
310313 response = await envellope.message.handle (sane);
311- } on SaneException catch (e) {
312- response = ExceptionResponse (exception: e);
314+ } on SaneException catch (exception, stackTrace) {
315+ response = ExceptionResponse (
316+ exception: exception,
317+ stackTrace: stackTrace,
318+ );
313319 }
314320
315321 envellope.replyPort.send (response);
You can’t perform that action at this time.
0 commit comments