fix (error): error display when ls failed

This commit is contained in:
Mickael Kerjean 2022-03-03 17:21:29 +11:00
parent 2c926df4f6
commit 91b85779d6
3 changed files with 3 additions and 4 deletions

View file

@ -29,9 +29,7 @@ class FileSystem {
if (keep_pulling_from_http === false) return Promise.resolve();
return fetch_from_http(_path);
}).catch((err) => {
if (cache === null) {
this.obs && this.obs.error({ message: "Unknown Path" });
}
this.obs && this.obs.error(err);
});
};
fetch_from_http(path);

View file

@ -127,7 +127,6 @@ export class FilesPageComponent extends React.Component {
this._cleanupListeners();
const observer = Files.ls(path, this.state.show_hidden).subscribe((res) => {
if (res.status !== "ok") {
notify.send(res, "error");
return;
}
this.setState({

View file

@ -254,6 +254,8 @@ func fromSambaErr(err error) error {
switch {
case os.IsPermission(err):
return ErrPermissionDenied
case os.IsNotExist(err):
return ErrNotFound
default:
return err
}