-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.core-llibrary-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Add a static rethrow method (with a different name since rethrow is reserved) that can synchronously throw an object and a stack trace. Currently there is no way to reuse an existing stack trace when throwing synchronously in a sync function, but you can do await new Future.error(object, stackTrace) in an async function. It's occasionally useful, and we have the functionality anyway (_rethrow in dart:async/zone.dart), so we should allow it in sync functions too.
Maybe as a static on Error: void Error.throwWithStack(Object error, [StackTrace stackTrace]); (maybe no need to make the stack trace optional, but it can then get the stackTrace from error if it implements Error).
ds84182, travissanderson-wf, alanrussian, nex3, tvolkert and 55 morePlugFox and TimWhiting
Metadata
Metadata
Assignees
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.core-llibrary-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug