Skip invalid vendors

This commit is contained in:
ExPikaPaka
2026-06-18 10:37:04 +02:00
committed by SoftFever
parent ff92efa91f
commit d85b555748

View File

@@ -90,6 +90,7 @@ int main(int argc, char* argv[])
int saved = 0, failed = 0; int saved = 0, failed = 0;
for (const auto& vendor_name : vendor_names) { for (const auto& vendor_name : vendor_names) {
try {
const std::string json_path = (fs::path(profiles_path) / (vendor_name + ".json")).string(); const std::string json_path = (fs::path(profiles_path) / (vendor_name + ".json")).string();
const std::string ver_str = get_vendor_cache_key(json_path); const std::string ver_str = get_vendor_cache_key(json_path);
@@ -104,7 +105,7 @@ int main(int argc, char* argv[])
// Verify the file was written and can be reloaded. // Verify the file was written and can be reloaded.
Slic3r::PresetBundle::VendorCache verify; Slic3r::PresetBundle::VendorCache verify;
if (!verify.load(cache_path) || !verify.is_valid(ver_str)) { if (!verify.load(cache_path) || !verify.is_valid(ver_str)) {
std::cerr << "WARNING: verification failed for " << cache_path << "\n"; std::cerr << "ERROR: " << vendor_name << ": verification failed\n";
++failed; ++failed;
} else { } else {
std::cout << " [ok] " << vendor_name << ".cache" std::cout << " [ok] " << vendor_name << ".cache"
@@ -116,6 +117,10 @@ int main(int argc, char* argv[])
total_printer += vc.printer_presets.size(); total_printer += vc.printer_presets.size();
++saved; ++saved;
} }
} catch (const std::exception& ex) {
std::cerr << "ERROR: " << vendor_name << ": " << ex.what() << "\n";
++failed;
}
} }
std::cout << "\nDone: " << saved << " cache(s) written"; std::cout << "\nDone: " << saved << " cache(s) written";