Skip to content

Commit

Permalink
[Files]: Fix format for errors reported when calling getMetada.
Browse files Browse the repository at this point in the history
String subtitution does not work correctly when tests are run. As a
result we get
"getMetadata error for: %s; error: (%d, %s, %s) ..." in the logs, rather
than correctly formatted strings. Also, if the error is not
DOMException, relying on presence or name, code, and message is a
mistake. It is better to use toString() method and let the exception
format itself. This is a follow-up to crrev.com/c/3812720

Bug: 1348455
Change-Id: I57325bdbc54f3f65ce92419b1ba4074fd6b7929a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3815102
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Bo Majewski <majewski@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032410}
  • Loading branch information
Bo Majewski authored and Chromium LUCI CQ committed Aug 8, 2022
1 parent 4825c02 commit 9f22cfd
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ export class FileSystemMetadataProvider extends MetadataProvider {
// console.error causes them to fail because of JSErrorCount.
// This error is an acceptable condition.
console.warn(
'getMetadata error for: %s; error: (%d, %s, %s)',
request.entry.toURL(), error.code, error.name,
error.message);
`getMetadata error for '${request.entry.toURL()}':`,
error.toString());
return new MetadataItem();
});
}));
Expand Down

0 comments on commit 9f22cfd

Please sign in to comment.