From ead9ccd5661be1b1a488fb15230332bee80b4d39 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 20 Jan 2021 10:11:00 +0000 Subject: [PATCH] build(docs-infra): fail gently if a changed file is unknown (#40479) When using `docs-watch` we try to match the changed file to a dgeni package in order to trigger a minimal set of processors. Previously, if the changed file could not be matched we emitted an ugly error. Now we provide a helpeful message. PR Close #40479 --- aio/tools/transforms/authors-package/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aio/tools/transforms/authors-package/index.js b/aio/tools/transforms/authors-package/index.js index cfb5dac96a..bfd523e008 100644 --- a/aio/tools/transforms/authors-package/index.js +++ b/aio/tools/transforms/authors-package/index.js @@ -51,6 +51,10 @@ module.exports = { generateDocs: function(changedFile, options = {}) { const {Dgeni} = require('dgeni'); const package = createPackage(changedFile); + if (package === undefined) { + console.log('The changed file was not matched to a dgeni package - skipping doc-gen'); + return Promise.resolve(); + } if (options.silent) { package.config(function(log) { log.level = 'error'; }); }