-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotriagedIssue has been triaged by sub teamIssue has been triaged by sub teamtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
It throws FileSystemException even when there is a more specific type that would fit if it failed due to "not found" or "access denied".
Here is a code snippet that converts to a better exception type.
try {
directory.resolveSymbolicLinksSync());
} on FileSystemException catch (e, s) {
if (e.message.contains('Cannot resolve symbolic links')) {
if (e.osError?.errorCode == 2) {
throw Error.throwWithStackTrace(
PathNotFoundException(directory.path, e.osError!), s);
} else if (e.osError?.errorCode == 5) {
throw Error.throwWithStackTrace(
PathAccessException(directory.path, e.osError!), s);
}
}
Discovered because of package:watcher code that tries to ignore specific subtypes of FileSystemException.
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotriagedIssue has been triaged by sub teamIssue has been triaged by sub teamtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug