We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
in Deno 2 we enabled useUnknownInCatchVariables by default. Previously the caught value would be any, now it is unknown.
any
unknown
try {} catch (error) { console.log(error.message); }
with Deno 1.x:
% deno --version deno 1.44.0 (release, aarch64-apple-darwin) v8 12.6.228.3 typescript 5.4.5 % deno check index.ts Check file:///Users/eduardoboucas/Sites/tests/deno-20-test/index.ts
with Deno 2.x:
% deno --version deno 2.0.6 (stable, release, aarch64-apple-darwin) v8 12.9.202.13-rusty typescript 5.6.2 % deno check index.ts Check file:///Users/eduardoboucas/Sites/tests/deno-20-test/index.ts error: TS18046 [ERROR]: 'error' is of type 'unknown'. console.log(error.message); ~~~~~ at file:///Users/eduardoboucas/Sites/tests/deno-20-test/index.ts:3:15
The text was updated successfully, but these errors were encountered:
No branches or pull requests
in Deno 2 we enabled useUnknownInCatchVariables by default. Previously the caught value would be
any
, now it isunknown
.with Deno 1.x:
with Deno 2.x:
The text was updated successfully, but these errors were encountered: