Skip to content

Commit

Permalink
feat: Improve FileSystemEntity messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed May 18, 2024
1 parent 3b02fba commit 3d15fc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/async.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
library async;

export 'src/exceptions.dart';
export 'src/file_system_converters.dart';
export 'src/shell_base.dart' hide $;
export 'src/shell_async.dart';
12 changes: 8 additions & 4 deletions lib/src/file_system_converters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class FileSystemEntityConverter extends Converter<String, FileSystemEntity> {
} else if (FileSystemEntity.isLinkSync(input)) {
return Link(input);
}
throw ShellResultConversionException(FileSystemEntity, input);
throw ShellResultConversionException(FileSystemEntity, input,
addtionalMessage: "The input was not an existing FileSystemEntity.");
}
}

Expand All @@ -30,7 +31,8 @@ class FileConverter extends Converter<String, File> {
if (file.existsSync()) {
return file;
}
throw ShellResultConversionException(File, input);
throw ShellResultConversionException(File, input,
addtionalMessage: "The input was not an existing File.");
}
}

Expand All @@ -45,7 +47,8 @@ class DirectoryConverter extends Converter<String, Directory> {
if (directory.existsSync()) {
return directory;
}
throw ShellResultConversionException(Directory, input);
throw ShellResultConversionException(Directory, input,
addtionalMessage: "The input was not an existing Directory.");
}
}

Expand All @@ -60,6 +63,7 @@ class LinkConverter extends Converter<String, Link> {
if (link.existsSync()) {
return link;
}
throw ShellResultConversionException(Link, input);
throw ShellResultConversionException(Link, input,
addtionalMessage: "The input was not an existing Link.");
}
}
1 change: 0 additions & 1 deletion lib/sync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
library sync;

export 'src/exceptions.dart';
export 'src/file_system_converters.dart';
export 'src/shell_base.dart' hide $;
export 'src/shell_sync.dart';

0 comments on commit 3d15fc2

Please sign in to comment.