refactor: remove unneeded ErrorKinds (#3936)

This commit is contained in:
Bartek Iwańczuk 2020-02-21 10:36:13 -05:00 committed by GitHub
parent d9efb8c02a
commit dd8a109481
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 553 additions and 620 deletions

View file

@ -6,7 +6,7 @@
// TODO Add tests like these:
// https://github.com/indexzero/http-server/blob/master/test/http-server-test.js
const { ErrorKind, DenoError, args, stat, readDir, open, exit } = Deno;
const { args, stat, readDir, open, exit } = Deno;
import { posix } from "../path/mod.ts";
import {
listenAndServe,
@ -163,7 +163,7 @@ async function serveDir(
}
async function serveFallback(req: ServerRequest, e: Error): Promise<Response> {
if (e instanceof DenoError && e.kind === ErrorKind.NotFound) {
if (e instanceof Deno.Err.NotFound) {
return {
status: 404,
body: encoder.encode("Not found")