Skip to content

Commit c786777

Browse files
committed
Add exception handling and better error output to VST3 validator
- Add try-catch around validation logic to handle exceptions - Add stderr output for errors to improve visibility in CI logs - This helps diagnose validation failures on macOS and Windows https://claude.ai/code/session_01AY9chvBEmsCVjNZSUkNcbw
1 parent 22cfb9e commit c786777

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

Source/vst3validator/VST3ValidatorRunner.cpp

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ Result runValidator (const Options& options)
7070
Result result;
7171
std::ostringstream outputStream;
7272

73-
outputStream << "VST3 Validator - pluginval integrated version\n";
74-
outputStream << "Validating: " << options.pluginPath << "\n";
73+
try
74+
{
75+
outputStream << "VST3 Validator - pluginval integrated version\n";
76+
outputStream << "Validating: " << options.pluginPath << "\n";
7577

7678
if (options.extendedMode)
7779
outputStream << "Extended validation mode enabled\n";
@@ -85,6 +87,8 @@ Result runValidator (const Options& options)
8587
if (! module)
8688
{
8789
outputStream << "Failed to load module: " << errorStr << "\n";
90+
// Also output to stderr for better visibility in case stdout is lost
91+
std::cerr << "VST3 Validator Error: Failed to load module: " << errorStr << std::endl;
8892
result.output = outputStream.str();
8993
result.exitCode = 1;
9094
result.success = false;
@@ -198,15 +202,32 @@ Result runValidator (const Options& options)
198202
outputStream << "\n";
199203
}
200204

201-
// Summary
202-
outputStream << "----------------------------------------\n";
203-
outputStream << "Validation Summary:\n";
204-
outputStream << " Audio Processor classes found: " << numProcessorClasses << "\n";
205-
outputStream << " Result: " << (allTestsPassed ? "PASSED" : "FAILED") << "\n";
205+
// Summary
206+
outputStream << "----------------------------------------\n";
207+
outputStream << "Validation Summary:\n";
208+
outputStream << " Audio Processor classes found: " << numProcessorClasses << "\n";
209+
outputStream << " Result: " << (allTestsPassed ? "PASSED" : "FAILED") << "\n";
206210

207-
result.output = outputStream.str ();
208-
result.success = allTestsPassed;
209-
result.exitCode = result.success ? 0 : 1;
211+
result.output = outputStream.str ();
212+
result.success = allTestsPassed;
213+
result.exitCode = result.success ? 0 : 1;
214+
}
215+
catch (const std::exception& e)
216+
{
217+
outputStream << "\nException caught: " << e.what() << "\n";
218+
std::cerr << "VST3 Validator Exception: " << e.what() << std::endl;
219+
result.output = outputStream.str();
220+
result.success = false;
221+
result.exitCode = 1;
222+
}
223+
catch (...)
224+
{
225+
outputStream << "\nUnknown exception caught\n";
226+
std::cerr << "VST3 Validator: Unknown exception caught" << std::endl;
227+
result.output = outputStream.str();
228+
result.success = false;
229+
result.exitCode = 1;
230+
}
210231

211232
return result;
212233
}

0 commit comments

Comments
 (0)