From 0dfaa6cc03f1e32eb73f0f29a78015a66ab0c786 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Thu, 17 Oct 2024 08:28:12 +0530 Subject: [PATCH] fix: Rethrow PathExistsException from canCreateFile --- packages/at_onboarding_cli/lib/src/cli/auth_cli.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/at_onboarding_cli/lib/src/cli/auth_cli.dart b/packages/at_onboarding_cli/lib/src/cli/auth_cli.dart index 65b2a333..ba62e6bf 100644 --- a/packages/at_onboarding_cli/lib/src/cli/auth_cli.dart +++ b/packages/at_onboarding_cli/lib/src/cli/auth_cli.dart @@ -460,6 +460,9 @@ bool canCreateFile(File file) { // This does not delete the existing file. Deletes only if the new file is created to verify write permissions. file.deleteSync(); return true; + } on PathExistsException { + stderr.writeln('Error : atKeys file ${file.path} already exists'); + rethrow; } on PathAccessException { stderr.writeln( 'Error : atKeys file ${file.path} does not have write permissions');