mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-11 13:16:38 +00:00
Return instead of throwing error
This commit is contained in:
@@ -31,19 +31,15 @@ export async function applyNewtDockerBlueprint(
|
|||||||
|
|
||||||
// make sure this is not an empty object
|
// make sure this is not an empty object
|
||||||
if (isEmptyObject(blueprint)) {
|
if (isEmptyObject(blueprint)) {
|
||||||
throw new Error("No valid blueprint data found in container labels");
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEmptyObject(blueprint["proxy-resources"])) {
|
if (isEmptyObject(blueprint["proxy-resources"])) {
|
||||||
throw new Error(
|
return;
|
||||||
"No proxy-resources found in blueprint data from container labels"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEmptyObject(blueprint["client-resources"])) {
|
if (isEmptyObject(blueprint["client-resources"])) {
|
||||||
throw new Error(
|
return;
|
||||||
"No client-resources found in blueprint data from container labels"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the blueprint in the database
|
// Update the blueprint in the database
|
||||||
@@ -79,4 +75,4 @@ function isEmptyObject(obj: any) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user