Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Add error reporting to catch typos
Browse files Browse the repository at this point in the history
  • Loading branch information
haltman-at committed Jun 5, 2020
1 parent f40af9f commit ea607e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/lib/debug/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CLIDebugger {
let warningStrings = [];
if (badFetchers.length > 0) {
warningStrings.push(
`Errors occurred connecting to ${badFetchers.join(", ")}$.`
`Errors occurred connecting to ${badFetchers.join(", ")}.`
);
}
if (badAddresses.length > 0) {
Expand Down
13 changes: 9 additions & 4 deletions packages/core/lib/debug/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ class DebugExternalHandler {
);
const userFetcherNames = this.config.sourceFetchers;
//sort/filter fetchers by user's order, if given; otherwise use default order
let sortedFetchers;
let sortedFetchers = [];
if (userFetcherNames) {
sortedFetchers = userFetcherNames
.map(name => allFetchers.find(Fetcher => Fetcher.fetcherName === name))
.filter(Fetcher => Fetcher !== undefined); //kind of a stupid way of writing this, but we're talking about *tiny* lists here
for (let name of userFetcherNames) {
let Fetcher = allFetchers.find(Fetcher => Fetcher.fetcherName === name);
if (Fetcher) {
sortedFetchers.push(Fetcher);
} else {
throw new Error(`Unknown external source service ${name}.`);
}
}
} else {
sortedFetchers = allFetchers;
}
Expand Down

0 comments on commit ea607e1

Please sign in to comment.