message: better errors in inline plugin
diff: @@ -94,21 +94,34 @@ export default function () {
  const path = posix.resolve(url, element.getAttribute("href"));
  const style = element.ownerDocument.createElement("style");
  + try {
  style.innerHTML = await getContent(path);
  element.replaceWith(style);
  + } catch {
  + throw new Error(
  + `Unable to inline the file ${path} from the page ${url}`,
  + );
  + }
  }
  async function inlineScript(url, element) {
  const path = posix.resolve(url, element.getAttribute("src"));
  + try {
  element.innerHTML = await getContent(path);
  element.removeAttribute("src");
  + } catch {
  + throw new Error(
  + `Unable to inline the file ${path} from the page ${url}`,
  + );
  + }
  }
  async function inlineSrc(url, element) {
  const path = resolve(url, element.getAttribute("src"));
  const ext = extname(path);
  + try {
  if (ext === ".svg") {
  const content = await getContent(path);
  const div = element.ownerDocument.createElement("div");
  @@ -118,11 +131,23 @@ export default function () {
  }
  element.setAttribute("src", await getContent(path, true));
  + } catch {
  + throw new Error(
  + `Unable to inline the file ${path} from the page ${url}`,
  + );
  + }
  }
  async function inlineHref(url, element) {
  const path = resolve(url, element.getAttribute("href"));
  +
  + try {
  element.setAttribute("href", await getContent(path, true));
  + } catch {
  + throw new Error(
  + `Unable to inline the file ${path} from the page ${url}`,
  + );
  + }
  }
  };
  }
  