Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions in transform block of Future doesn't appear #3489

Closed
DartBot opened this issue Jun 10, 2012 · 4 comments
Closed

Exceptions in transform block of Future doesn't appear #3489

DartBot opened this issue Jun 10, 2012 · 4 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

Comments

@DartBot
Copy link

DartBot commented Jun 10, 2012

This issue was originally filed by VadimTs...@gmail.com


What steps will reproduce the problem?

  1. Load and run https://gist.github.com/2905962

What is the expected output? What do you see instead?
Expected behaviour:
Consose output 'Before exception in transform block'
Stacktrace on error 'Error in transform block'
Instead I see only consose output 'Before exception in transform block'

What version of the product are you using? On what operating system?
dart-sdk revisions 8370 and 8478. On Windows 32bit.

@DartBot
Copy link
Author

DartBot commented Jun 10, 2012

This comment was originally written by sammcca...@google.com


The issue here is the strange behaviour of Future when a .then() is used without .handleException().

This causes Completer.completeException() to synchronously throws its argument.
In this case, the caller of completeException (on the transformed future completer) is an onComplete() handler of the original future. It can't do anything useful with the exception (in particular, it can't propagate it).

The best fix IMO is to make completion always asynchronous (this is a more general version of issue #3356).
That is, instead of throwing the exception, completeException() should do some portable equivalent of new Timer(0, (t) => throw exception);

A workaround for now is to handleException along with then(), or use onComplete.

@DartBot
Copy link
Author

DartBot commented Jun 10, 2012

This comment was originally written by sammcca...@google.com


I can write a patch reverting the changes to transform() and chain() from 2906010 until completions can be asynchronous.

@dgrove
Copy link
Contributor

dgrove commented Jun 11, 2012

cc @sigmundch.
Added Area-Library, Triaged labels.

@sigmundch
Copy link
Member

fixed in r8501


Added Fixed label.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Jun 11, 2012
copybara-service bot pushed a commit that referenced this issue Sep 5, 2023
…ion, dartdoc, ecosystem, file, glob, html, http_multi_server, http_parser, json_rpc_2, mockito, package_config, protobuf, pub_semver, source_maps, source_span, sync_http, test_reflective_loader, usage, vector_math, web_socket_channel, webdriver

Revisions updated by `dart tools/rev_sdk_deps.dart`.

args (https://github.com/dart-lang/args/compare/da56b18..5a4e16f):
  5a4e16f  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#254)

bazel_worker (https://github.com/dart-lang/bazel_worker/compare/f950bbf..159e671):
  159e671  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#80)

benchmark_harness (https://github.com/dart-lang/benchmark_harness/compare/fde73cb..7d0d28e):
  7d0d28e  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#92)

characters (https://github.com/dart-lang/characters/compare/ec844db..7633a16):
  7633a16  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#86)

collection (https://github.com/dart-lang/collection/compare/1a9b7eb..91afde4):
  91afde4  2023-09-02  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#311)

dartdoc (https://github.com/dart-lang/dartdoc/compare/695b218..a32ba3a):
  a32ba3a1  2023-09-05  Parker Lougheed  Enable accidentally disabled reflective parameter test (#3490)
  0c0cb4ed  2023-09-04  dependabot[bot]  Bump actions/checkout from 3.5.3 to 4.0.0 (#3492)
  08d8d9c4  2023-09-01  Sam Rawlins  Implement much support for extension types (#3489)

ecosystem (https://github.com/dart-lang/ecosystem/compare/89e58de..2e6c3ec):
  2e6c3ec  2023-09-05  Hossein Yousefi  Fix Publish Workflow (#162)
  2e532e3  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#161)

file (https://github.com/google/file.dart/compare/5d9a602..a18ad1c):
  a18ad1c  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.6.0 (#228)

glob (https://github.com/dart-lang/glob/compare/5b24393..9c1996f):
  9c1996f  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#82)

html (https://github.com/dart-lang/html/compare/4060496..a1b193e):
  a1b193e  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#225)

http_multi_server (https://github.com/dart-lang/http_multi_server/compare/aa128cf..9d62ea3):
  9d62ea3  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#57)

http_parser (https://github.com/dart-lang/http_parser/compare/c14fbf6..d2d03e7):
  d2d03e7  2023-09-02  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#77)

json_rpc_2 (https://github.com/dart-lang/json_rpc_2/compare/509f71e..50a3786):
  50a3786  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#101)

mockito (https://github.com/dart-lang/mockito/compare/f5abf11..412c0be):
  412c0be  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#692)

package_config (https://github.com/dart-lang/package_config/compare/981c49d..ae7ad83):
  ae7ad83  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#140)

protobuf (https://github.com/dart-lang/protobuf/compare/5e8f36b..c16bc89):
  c16bc89  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.6.0 (#873)

pub_semver (https://github.com/dart-lang/pub_semver/compare/028b435..f0be74a):
  f0be74a  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#91)

source_maps (https://github.com/dart-lang/source_maps/compare/97c4833..eb3d40a):
  eb3d40a  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#81)

source_span (https://github.com/dart-lang/source_span/compare/37735ae..48d0f57):
  48d0f57  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#101)

sync_http (https://github.com/dart-lang/sync_http/compare/c3d6ad4..8233f74):
  8233f74  2023-09-01  Devon Carew  Merge pull request #37 from google/dependabot/github_actions/actions/checkout-3.6.0
  57dc02b  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.6.0

test_reflective_loader (https://github.com/dart-lang/test_reflective_loader/compare/0bfaad9..45c57d6):
  45c57d6  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#51)

usage (https://github.com/dart-lang/usage/compare/09bb847..7b12d51):
  7b12d51  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#197)

vector_math (https://github.com/google/vector_math.dart/compare/88bada3..d54af8a):
  d54af8a  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.6.0 (#301)

web_socket_channel (https://github.com/dart-lang/web_socket_channel/compare/4d1b543..af945f1):
  af945f1  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#283)

webdriver (https://github.com/google/webdriver.dart/compare/20ec47f..21976d6):
  21976d6  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.6.0 (#279)
  352b9b6  2023-09-01  dependabot[bot]  Bump nanasess/setup-chromedriver from 1.1.0 to 2.2.0 (#278)

Change-Id: I0b1f7a8851a7ee992d5b67a221ab523f55b51240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324261
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Projects
None yet
Development

No branches or pull requests

3 participants