mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
Make writeSync, readSync, seekSync, openSync, isatty proper synchronous syscalls (#4762)
This commit is contained in:
parent
7cfd094359
commit
fab0204cbf
11 changed files with 350 additions and 196 deletions
|
@ -23,6 +23,7 @@ export enum ErrorKind {
|
|||
URIError = 20,
|
||||
TypeError = 21,
|
||||
Other = 22,
|
||||
Busy = 23,
|
||||
}
|
||||
|
||||
export function getErrorClass(kind: ErrorKind): { new (msg: string): Error } {
|
||||
|
@ -67,6 +68,8 @@ export function getErrorClass(kind: ErrorKind): { new (msg: string): Error } {
|
|||
return BadResource;
|
||||
case ErrorKind.Http:
|
||||
return Http;
|
||||
case ErrorKind.Busy:
|
||||
return Busy;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,6 +175,12 @@ class Http extends Error {
|
|||
this.name = "Http";
|
||||
}
|
||||
}
|
||||
class Busy extends Error {
|
||||
constructor(msg: string) {
|
||||
super(msg);
|
||||
this.name = "Busy";
|
||||
}
|
||||
}
|
||||
|
||||
export const errors = {
|
||||
NotFound: NotFound,
|
||||
|
@ -191,4 +200,5 @@ export const errors = {
|
|||
UnexpectedEof: UnexpectedEof,
|
||||
BadResource: BadResource,
|
||||
Http: Http,
|
||||
Busy: Busy,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue