[PR Feedback] Make missing default files a runtime error
If any such files are missing, that's an error on our part. Missing
files could manifest in unforeseen issues in the studio, so we'll
fail-fast.
@@ -1116,9 +1116,7 @@ copy_minimal_default_file() {
if [ -f "${defaults_path}${file_path}" ]; then
$bb cp -f "${defaults_path}${file_path}" "${HAB_STUDIO_ROOT}${file_path}"
else
- echo
- echo "Tried to copy default file for '${file_path}', but could not find one! Please report this error."
- echo
+ exit_with "Tried to copy default file for '${file_path}', but could not find one! Please report this error." "${ERR_RUNTIME_CODING_ERROR}"
fi
}
@@ -1146,6 +1144,9 @@ HAB_PKG_PATH=$HAB_ROOT_PATH/pkgs
# installation
HAB_CACHE_ARTIFACT_PATH=$HAB_ROOT_PATH/cache/artifacts
+# The exit code for a coding error that manifests at runtime
+ERR_RUNTIME_CODING_ERROR=70
+
# The exit code if unmounting a filesystem fails
ERR_UMOUNT_FAILED=80
# The exit code if after a successful unmount, the filesystem is still mounted
