Skip to content

Strange error message from httpserver when passing in wrong argument to write #3195

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

Closed
ricowind opened this issue May 24, 2012 · 3 comments
Closed
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-as-intended Closed as the reported issue is expected behavior library-io
Milestone

Comments

@ricowind
Copy link
Contributor

When I pass in a string to response.outputStream.write (should be writeString, but I am talking about the error message here) I get

Unhandled exception:
FileIOException: List element is not an integer at index 0
 0. Function: '[email protected]' url: 'dart:io' line:488 col:193
 1. Function: '_HttpConnection@14117cc4._onConnectionClosed@14117cc4' url: 'dart:io' line:477 col:57
 2. Function: '_HttpConnectionBase@14117cc4._onError@14117cc4' url: 'dart:io' line:467 col:174
 3. Function: '[email protected]' url: 'dart:io' line:476 col:218
 4. Function: '[email protected]' url: 'dart:io' line:649 col:514
 5. Function: '_HttpConnectionBase@14117cc4._onData@14117cc4' url: 'dart:io' line:464 col:91
 6. Function: '_SocketBase@14117cc4._multiplex@14117cc4' url: 'dart:io' line:908 col:107
 7. Function: '[email protected]' url: 'dart:io' line:920 col:65
 8. Function: '_ReceivePortImpl@6be832b._handleMessage@6be832b' url: 'dart:isolate' line:19 col:46

If I run in checked mode it is even worse:

Unhandled exception:
type 'OneByteString' is not a subtype of type 'List<int>' of 'buffer'.
 0. Function: '[email protected]' url: 'dart:io' line:488 col:193
 1. Function: '_HttpConnection@14117cc4._onConnectionClosed@14117cc4' url: 'dart:io' line:477 col:57
 2. Function: '_HttpConnectionBase@14117cc4._onError@14117cc4' url: 'dart:io' line:467 col:174
 3. Function: '[email protected]' url: 'dart:io' line:476 col:218
 4. Function: '[email protected]' url: 'dart:io' line:649 col:514
 5. Function: '_HttpConnectionBase@14117cc4._onData@14117cc4' url: 'dart:io' line:464 col:91
 6. Function: '_SocketBase@14117cc4._multiplex@14117cc4' url: 'dart:io' line:908 col:107
 7. Function: '[email protected]' url: 'dart:io' line:920 col:65
 8. Function: '_ReceivePortImpl@6be832b._handleMessage@6be832b' url: 'dart:isolate' line:19 col:46

@madsager
Copy link
Contributor

madsager commented Jun 7, 2012

It should be an easy fix to check up front that the argument is a list and report a more meaningful error message if it isn't.


cc @sgjesse.
Set owner to @whesse.
Added this to the M1 milestone.

@madsager
Copy link
Contributor

I don't think we should do anything here.

We have enough checks in the dart code that this does not crash but gives you an exception. We should not add extra type checks in non-checked mode which will only slow down the system.

If you run in checked mode the exception clearly tells you that you are passing a 'String' (and the current VM does not write 'OneByteString' anymore but only 'String') to something that expects a 'List<int>'. If you run through the editor in checked mode you will get a stack trace that led to this checked-mode exception and your offending code will be on the stack and easy to find.


cc @ricowind.
Added AsDesigned label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@ricowind ricowind added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io closed-as-intended Closed as the reported issue is expected behavior labels May 14, 2014
@ricowind ricowind added this to the M1 milestone May 14, 2014
copybara-service bot pushed a commit that referenced this issue Oct 29, 2021
Changes:
```
> git log --format="%C(auto) %h %s" 78bc50c..0035a40
 https://dart.googlesource.com/pub.git/+/0035a40f Fix echo mode crash on `token add` (#3194)
 https://dart.googlesource.com/pub.git/+/a75a8c17 Don't warn against discontinued transitive dependencies (#3195)
 https://dart.googlesource.com/pub.git/+/cf2ed105 Fix analytics code (#3197)
 https://dart.googlesource.com/pub.git/+/08e13f7b Remove unused golden files (#3189)
 https://dart.googlesource.com/pub.git/+/b6293b80 Fix log message related to `pub global activate`  (#3187)
 https://dart.googlesource.com/pub.git/+/94f6b477 Introducing command-line interface tests (#3161)
 https://dart.googlesource.com/pub.git/+/3ba8134f More details from getExecutableForCommand (#3186)
 https://dart.googlesource.com/pub.git/+/a2dbcfff Shorthand syntax for hosted dependencies (#3133)
 https://dart.googlesource.com/pub.git/+/435e4e3f Shuffle analytics (#3185)

```

Diff: https://dart.googlesource.com/pub.git/+/78bc50c7833451c24e531713362e46fd50621ff0~..0035a40f25d027130c0314571da53ffafc6d973b/
Change-Id: Idfd7c382985d1ad3e3ad87a621dc79d3b74e898e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218620
Reviewed-by: Jonas Jensen <[email protected]>
Commit-Queue: Sigurd Meldgaard <[email protected]>
copybara-service bot pushed a commit that referenced this issue Sep 29, 2022
…3 revisions)

https://dart.googlesource.com/dartdoc/+log/691fa9640aae..62bc1503b285

2022-09-28 [email protected] Fix styles in inline search results (#3197)
2022-09-28 [email protected] Simplify some code in dartdoc_options.dart (#3156)
2022-09-28 [email protected] Prevent default when hitting enter (#3195)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: [email protected]
Change-Id: I51527ab30a73a73de95f53715e83488562a54c71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261445
Reviewed-by: Kevin Moore <[email protected]>
Commit-Queue: Devon Carew <[email protected]>
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. closed-as-intended Closed as the reported issue is expected behavior library-io
Projects
None yet
Development

No branches or pull requests

4 participants