Commit 898c19c8 authored by François Degros's avatar François Degros Committed by Commit Bot

Files app: Added some error logs

Combed log and error messages related to mounting and unmounting of file
systems.

Change-Id: I07acbdb4ccbc22aa913cb776c1d515c01a226422
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732672Reviewed-by: default avatarAustin Tankiang <austinct@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683892}
parent 6a7008ea
...@@ -174,6 +174,8 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -174,6 +174,8 @@ class VolumeManagerImpl extends cr.EventTarget {
const volumeInfo = const volumeInfo =
await this.addVolumeMetadata_(event.volumeMetadata); await this.addVolumeMetadata_(event.volumeMetadata);
this.finishRequest_(requestKey, event.status, volumeInfo); this.finishRequest_(requestKey, event.status, volumeInfo);
console.warn(`Mounted '${event.volumeMetadata.sourcePath}' as '${
event.volumeMetadata.volumeId}'`);
break; break;
} }
...@@ -184,6 +186,9 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -184,6 +186,9 @@ class VolumeManagerImpl extends cr.EventTarget {
navigationEvent.volumeId = event.volumeMetadata.volumeId; navigationEvent.volumeId = event.volumeMetadata.volumeId;
this.dispatchEvent(navigationEvent); this.dispatchEvent(navigationEvent);
this.finishRequest_(requestKey, event.status); this.finishRequest_(requestKey, event.status);
console.error(`'Cannot mount ${
event.volumeMetadata.sourcePath}': Already mounted as '${
event.volumeMetadata.volumeId}'`);
break; break;
} }
...@@ -211,6 +216,9 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -211,6 +216,9 @@ class VolumeManagerImpl extends cr.EventTarget {
this.finishRequest_(requestKey, status); this.finishRequest_(requestKey, status);
if (event.status === 'success') { if (event.status === 'success') {
this.volumeInfoList.remove(event.volumeMetadata.volumeId); this.volumeInfoList.remove(event.volumeMetadata.volumeId);
console.warn(`Unmounted '${volumeId}'`);
} else {
console.error(`Cannot unmount '${volumeId}': ${event.status}`);
} }
break; break;
...@@ -240,9 +248,7 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -240,9 +248,7 @@ class VolumeManagerImpl extends cr.EventTarget {
}); });
console.warn(`Mounting '${path}'`); console.warn(`Mounting '${path}'`);
const key = this.makeRequestKey_('mount', path); const key = this.makeRequestKey_('mount', path);
const volumeInfo = await this.startRequest_(key); return this.startRequest_(key);
console.warn(`Mounted '${path}' as '${volumeInfo.volumeId}'`);
return volumeInfo;
} }
/** @override */ /** @override */
...@@ -251,7 +257,6 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -251,7 +257,6 @@ class VolumeManagerImpl extends cr.EventTarget {
chrome.fileManagerPrivate.removeMount(volumeInfo.volumeId); chrome.fileManagerPrivate.removeMount(volumeInfo.volumeId);
const key = this.makeRequestKey_('unmount', volumeInfo.volumeId); const key = this.makeRequestKey_('unmount', volumeInfo.volumeId);
await this.startRequest_(key); await this.startRequest_(key);
console.warn(`Unmounted '${volumeInfo.volumeId}'`);
} }
/** @override */ /** @override */
......
...@@ -592,7 +592,7 @@ CommandHandler.COMMANDS_['unmount'] = new class extends Command { ...@@ -592,7 +592,7 @@ CommandHandler.COMMANDS_['unmount'] = new class extends Command {
await fileManager.volumeManager.unmount(volume); await fileManager.volumeManager.unmount(volume);
} catch (error) { } catch (error) {
console.error( console.error(
`Cannot unmount ${volume.volumeId}: ${error.stack || error}`); `Cannot unmount '${volume.volumeId}': ${error.stack || error}`);
errorCallback(volume.volumeType); errorCallback(volume.volumeType);
} }
}); });
......
...@@ -922,6 +922,7 @@ class FileTasks { ...@@ -922,6 +922,7 @@ class FileTasks {
this.ui_.alertDialog.show( this.ui_.alertDialog.show(
strf('ARCHIVE_MOUNT_FAILED', path.substr(namePos + 1), error), strf('ARCHIVE_MOUNT_FAILED', path.substr(namePos + 1), error),
null, null); null, null);
console.error(`Cannot mount '${path}': ${error.stack || error}`);
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment