diff --git a/lib/src/io/node.dart b/lib/src/io/node.dart index f8ac7f12..680b950f 100644 --- a/lib/src/io/node.dart +++ b/lib/src/io/node.dart @@ -182,9 +182,9 @@ T _systemErrorToFileSystemException(T callback()) { try { return callback(); } catch (error) { - var systemError = error as JsSystemError; + if (error is! JsSystemError) rethrow; throw FileSystemException._( - _cleanErrorMessage(systemError), systemError.path); + _cleanErrorMessage(error), error.path); } }