From 7bfcb4dd10d31f5f9566c90a28449c0951f3a48e Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 10 Sep 2024 20:12:24 +0200 Subject: feat(cli): use NotCapable error for permission errors (#25431) Closes #7394 --------- Co-authored-by: snek --- cli/tsc/dts/lib.deno.ns.d.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cli/tsc/dts/lib.deno.ns.d.ts') diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 1cf6667b1..9a77bd188 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -175,8 +175,11 @@ declare namespace Deno { /** * Raised when the underlying operating system indicates the current user * which the Deno process is running under does not have the appropriate - * permissions to a file or resource, or the user _did not_ provide required - * `--allow-*` flag. + * permissions to a file or resource. + * + * Before Deno 2.0, this error was raised when the user _did not_ provide + * required `--allow-*` flag. As of Deno 2.0, that case is now handled by + * the {@link NotCapable} error. * * @category Errors */ export class PermissionDenied extends Error {} @@ -314,6 +317,15 @@ declare namespace Deno { * * @category Errors */ export class NotADirectory extends Error {} + /** + * Raised when trying to perform an operation while the relevant Deno + * permission (like `--allow-read`) has not been granted. + * + * Before Deno 2.0, this condition was covered by the {@link PermissionDenied} + * error. + * + * @category Errors */ + export class NotCapable extends Error {} } /** The current process ID of this instance of the Deno CLI. -- cgit v1.2.3