John Vilk
|
cddd0b7aab
|
[Node] Node attaches errno information to some exceptions.
This is valuable information for Node applications that need to figure out why a particular system call failed.
Note that errno can either be a string or a number, which is why I have typed it as 'any'.
While this is undocumented, it is tested:
Code property: https://github.com/joyent/node/blob/v0.10.23-release/test/simple/test-fs-open.js#L34
Errno property [string]: https://github.com/joyent/node/blob/v0.10.23-release/test/internet/test-dns.js#L148
Errno property [number]: https://github.com/joyent/node/blob/v0.10.23-release/test/simple/test-domain-implicit-fs.js#L43
Syscall property: https://github.com/joyent/node/blob/v0.10.23-release/test/simple/test-stdout-close-catch.js#L38
Path property (I can’t find a test, but many examples have this line): https://github.com/joyent/node/blob/v0.10.23-release/deps/npm/node_modules/fstream-npm/example/bundle.js#L6
..and well supported in the code for all platforms (this is where I got the name 'ErrnoException' from):
*nix: https://github.com/joyent/node/blob/v0.10.23-release/src/node.cc#L719
Windows: https://github.com/joyent/node/blob/v0.10.23-release/src/node.cc#L856
Unfortunately, while every errno exception is guaranteed to have the ‘errno’ and ‘code’ properties (see the logic in the source code in node.cc), there is no hard guarantee that particular library functions will always pass an ErrnoException to the callback. I cannot find a counterexample at this moment, though. Since we can’t have union types in TypeScript, I simply made all of the properties on ErrnoException optional as a compromise.
I am only adding modifications to the fs module, which definitely throws ErrnoExceptions. But according to the examples above, other modules (e.g. dns) also pass errno information back to applications. People familiar with those other modules can update their typings to reference this interface when applicable; I lack the experience with those modules to update their typings.
Further proof:
```javascript
$ node
> var fs = require('fs');
undefined
> fs.open('doesntexistlol', 'r', function(e) { console.log(Object.keys(e)); console.log(e.code); console.log(e.errno); console.log(e.path); });
undefined
> [ 'errno', 'code', 'path' ]
ENOENT
34
doesntexistlol
```
|
2013-12-17 16:36:08 -05:00 |
|
Richard Hepburn
|
93d4a19972
|
Added TypeScript Definition files for Html2Canvas
Added TypeScript Definition files for Html2Canvas - a library for taking
screenshots of a browser window.
|
2013-12-17 11:29:04 -05:00 |
|
Matthew James Davis
|
939223787d
|
update
|
2013-12-17 11:14:41 -05:00 |
|
Matthew James Davis
|
8e06913b6a
|
Merge branch 'master' of https://github.com/mapsjs/DefinitelyTyped
Conflicts:
mapsjs/mapsjs.d.ts
|
2013-12-17 11:14:01 -05:00 |
|
Matthew James Davis
|
d82aee98f0
|
update
|
2013-12-17 11:08:13 -05:00 |
|
Basarat Ali Syed
|
718eff7763
|
Merge pull request #1456 from daptiv/54952-use-new-tslint-rules
Update angular resource definitions, and add injector definition
|
2013-12-17 02:34:08 -08:00 |
|
John Emau
|
459e286cd0
|
added syntax highlighting
|
2013-12-16 19:17:47 -08:00 |
|
John Emau
|
a859e22699
|
added missing test for resource service factory and updated readme
|
2013-12-16 19:15:42 -08:00 |
|
John Emau
|
71e23deadd
|
added tests for new angular-resource generics signatures
|
2013-12-16 19:03:37 -08:00 |
|
Jonathan Park
|
72cc261506
|
adding invoke inline annotated functions
|
2013-12-16 17:39:28 -08:00 |
|
Jonathan Park
|
41a7127404
|
updating angular resource and injector definitions
|
2013-12-16 17:17:39 -08:00 |
|
Basarat Ali Syed
|
8828800831
|
Merge pull request #1383 from jedmao/handlebars
Fix Ember/Handlebars
|
2013-12-16 16:26:32 -08:00 |
|
Igor Oleinikov
|
7fcae51ab1
|
rx.js: added Observable.zipArray overload (by https://github.com/Reactive-Extensions/RxJS/issues/79)
|
2013-12-16 23:02:19 +04:00 |
|
George Valotasios
|
47bcdb5cd8
|
Just a dummy eol to cause travis to rebuild
|
2013-12-16 15:27:51 +01:00 |
|
Igor Oleinikov
|
a0bce74b1c
|
rx.js: fixed --noImplicitAny errors
|
2013-12-16 16:02:13 +04:00 |
|
Igor Oleinikov
|
9381a60dcb
|
knockout.rx: fixed reference to rx.js
|
2013-12-16 15:57:03 +04:00 |
|
Basarat Ali Syed
|
1d30cca2e7
|
Merge pull request #1453 from damianog/patch-9
Update highcharts.d.ts Fixed missing type declarations.
|
2013-12-16 03:47:40 -08:00 |
|
Basarat Ali Syed
|
efd60916df
|
Merge pull request #1452 from damianog/patch-8
Update globalize.d.ts 'format' lacks return-type annotation
|
2013-12-16 03:47:15 -08:00 |
|
Igor Oleinikov
|
9f7339ed64
|
rx.js: updated README.md contributors for rx.js
|
2013-12-16 15:33:29 +04:00 |
|
Igor Oleinikov
|
ba81c30675
|
rx.js: fixed references rx.js.* -> rx.*
|
2013-12-16 15:28:25 +04:00 |
|
Igor Oleinikov
|
f61f1bbd53
|
Removed rx-tests.ts via TS bug https://typescript.codeplex.com/workitem/2011
|
2013-12-16 14:02:11 +04:00 |
|
Igor Oleinikov
|
a2186d9162
|
Fixed reference in rx-tests.ts
|
2013-12-16 12:57:25 +04:00 |
|
Igor Oleinikov
|
8830407d01
|
Merge branch 'rx.js' into switch-0.9.5
|
2013-12-16 11:40:48 +04:00 |
|
Igor Oleinikov
|
6ac83ca52e
|
Updated rx.jquery.d.ts
|
2013-12-16 11:24:24 +04:00 |
|
Igor Oleinikov
|
249fd303b3
|
Renamed rx.js.*.d.ts files into rx.*.d.ts; fixed references
|
2013-12-16 09:58:41 +04:00 |
|
Basarat Ali Syed
|
30a55d258b
|
Merge pull request #1454 from michalkutil/master
jQuery: The interface used to specify easing functions add
|
2013-12-15 15:16:22 -08:00 |
|
Michal Kutil
|
0d2fb0d17a
|
jQuery: The interface used to specify easing functions add
|
2013-12-15 23:04:05 +01:00 |
|
Igor Oleinikov
|
58a5b53bcd
|
rx.js: removed *.tscparams files
|
2013-12-16 00:29:27 +04:00 |
|
Igor Oleinikov
|
519423ea9a
|
Added rx.testing.d.ts: TestScheduler, ReactiveTest, Subscription, MockObserver, Recorded
|
2013-12-16 00:19:41 +04:00 |
|
Igor Oleinikov
|
1e8d71d7e3
|
Created typings for rx.joinpatterns: Patterns, Plan, Observable.when
|
2013-12-15 23:18:20 +04:00 |
|
Igor Oleinikov
|
6033488b47
|
updated rx.js.coincidence.d.ts: added overloads for window and buffer
|
2013-12-15 21:38:05 +04:00 |
|
Igor Oleinikov
|
b5a1466ead
|
updated rx.js.async.d.ts: created lot of typed overloads for toAsync, fromCallback, fromNodeCallback
|
2013-12-15 21:16:51 +04:00 |
|
Masahiro Wakame
|
909a178441
|
Merge pull request #1442 from brettpostin/patch-1
Update to resolve issue #1434
|
2013-12-15 06:50:22 -08:00 |
|
damianog
|
a3cca0d72f
|
Update highcharts.d.ts
Fixed missing type declarations.
|
2013-12-15 13:50:21 +01:00 |
|
damianog
|
ef0db52948
|
Update globalize.d.ts
'format' lacks return-type annotation
|
2013-12-15 13:16:39 +01:00 |
|
Igor Oleinikov
|
18c862f14c
|
rx.js.aggregates.d.ts: added reduce function
|
2013-12-15 11:55:41 +04:00 |
|
Igor Oleinikov
|
6cd535fbbc
|
rx.js.aggregates.d.ts: added find, findIndex functions
|
2013-12-15 11:52:05 +04:00 |
|
Igor Oleinikov
|
8a8a3cf9bf
|
Updated rx.js.aggregates.d.ts
|
2013-12-15 11:49:09 +04:00 |
|
Igor Oleinikov
|
9c2f13f04d
|
rx.js.virtualtime.d.ts: updated names, added HistoricalScheduler
rx.js.d.ts: updated names, moved some interfaces to Internal
|
2013-12-15 11:21:23 +04:00 |
|
Jed Hunsaker
|
a63e5a7e1e
|
Fix Ember/Handlebars
|
2013-12-14 14:21:00 -06:00 |
|
Paul Loyd
|
61d7c7cb00
|
node-ffi: adopt for --noImplicitAny
|
2013-12-15 00:05:05 +04:00 |
|
Igor Oleinikov
|
36513cf85f
|
rx.js.d.ts: updated many of Observable methods
added tests for Observable instance methods
|
2013-12-14 17:18:44 +04:00 |
|
Václav Oborník
|
ee212d0ece
|
Restify: updated plugin defintions, allowed --noImplicitAny compile flag
|
2013-12-14 00:06:24 +01:00 |
|
Igor Oleinikov
|
09a654307a
|
rx.js: renamed some interfaces to documentation consistent names (IObservable->Observable)
added test for rx.js.d.ts
|
2013-12-14 00:36:32 +04:00 |
|
damianog
|
0e8a450390
|
Update angular-scenario.d.ts
'enter' lacks return-type annotation, implicitly has an 'any' return type
|
2013-12-13 19:49:11 +01:00 |
|
George Valotasios
|
e9402f9f23
|
Removed the extends from the IRouter definition
|
2013-12-13 14:22:49 +01:00 |
|
Thomas Butler
|
cbc8adfb1e
|
removed duplicate identifier 'update'
|
2013-12-13 07:25:35 -05:00 |
|
Thomas Butler
|
e61f72fd71
|
removed access of non-existant property
|
2013-12-13 07:24:45 -05:00 |
|
Thomas Butler
|
18beeab5e2
|
changed [illegal] variant type usage to a prefered static typing
|
2013-12-13 07:20:48 -05:00 |
|
George Valotasios
|
bdd3ad1e62
|
Make use of generics for IRouter
so that we do not have to override everyting at the Application
interface
|
2013-12-13 13:13:11 +01:00 |
|