fix error case cause failure to load anything

pull/100/head v0.3.10
Ben Phelps 2 years ago
parent e3237b9022
commit d861264ecf

@ -1,8 +1,20 @@
import { servicesFromConfig, servicesFromDocker, cleanServiceGroups } from "utils/service-helpers";
export default async function handler(req, res) {
const discoveredServices = cleanServiceGroups(await servicesFromDocker());
const configuredServices = cleanServiceGroups(await servicesFromConfig());
let discoveredServices;
let configuredServices;
try {
discoveredServices = cleanServiceGroups(await servicesFromDocker());
} catch {
discoveredServices = [];
}
try {
configuredServices = cleanServiceGroups(await servicesFromConfig());
} catch {
configuredServices = [];
}
const mergedGroupsNames = [
...new Set([discoveredServices.map((group) => group.name), configuredServices.map((group) => group.name)].flat()),

Loading…
Cancel
Save