Change recently added catch blocks to use const references

It's been a while since I've done much C++ v.v
This commit is contained in:
Tabby Cromarty
2025-10-18 21:58:08 +01:00
parent d88635e0fe
commit 5398d62fb8
2 changed files with 3 additions and 3 deletions

View File

@@ -665,7 +665,7 @@ void recording_state_callback(enum obs_frontend_event event, void *data)
newPath = recordingPath.parent_path() / newPath.filename();
fs::rename(outputPath, newPath);
} catch (std::filesystem::filesystem_error e) {
} catch (const std::filesystem::filesystem_error &e) {
obs_log(LOG_ERROR, "Error renaming output file - %s", e.what());
}
} else if (event == OBS_FRONTEND_EVENT_STREAMING_STARTING) {

View File

@@ -321,7 +321,7 @@ void VadIterator::process(const std::vector<float> &input_wav, bool reset_state)
triggered = false;
}
}
catch (Ort::Exception e) {
catch (const Ort::Exception &e) {
obs_log(LOG_ERROR, "Caught exception when running VAD prediction. Error code: %s, message: %s",
ort_error_code_str(e.GetOrtErrorCode()), e.what());
}
@@ -333,7 +333,7 @@ void VadIterator::process(const std::vector<float> &input_wav, std::vector<float
process(input_wav);
collect_chunks(input_wav, output_wav);
}
catch (Ort::Exception e) {
catch (const Ort::Exception &e) {
obs_log(LOG_ERROR, "Caught exception when running VAD prediction. Error code: %s, message: %s",
ort_error_code_str(e.GetOrtErrorCode()), e.what());
}