mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-24 12:57:31 +02:00
Unify exception handling style
This commit is contained in:
@@ -671,7 +671,7 @@ class AdHocSocketHandler {
|
|||||||
secondary_socket.connect(endpoint);
|
secondary_socket.connect(endpoint);
|
||||||
|
|
||||||
return callback(secondary_socket);
|
return callback(secondary_socket);
|
||||||
} catch (const boost::system::system_error& e) {
|
} catch (const boost::system::system_error&) {
|
||||||
// So, what do we do when noone is listening on the endpoint
|
// So, what do we do when noone is listening on the endpoint
|
||||||
// yet? This can happen with plugin groups when the Wine
|
// yet? This can happen with plugin groups when the Wine
|
||||||
// host process does an `audioMaster()` call before the
|
// host process does an `audioMaster()` call before the
|
||||||
@@ -699,7 +699,7 @@ class AdHocSocketHandler {
|
|||||||
} else {
|
} else {
|
||||||
// Rethrow the exception if the sockets we're not
|
// Rethrow the exception if the sockets we're not
|
||||||
// handling the specific case described above
|
// handling the specific case described above
|
||||||
throw e;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ intptr_t Vst2PluginBridge::dispatch(AEffect* /*plugin*/,
|
|||||||
return_value = sockets.host_vst_dispatch.send_event(
|
return_value = sockets.host_vst_dispatch.send_event(
|
||||||
converter, std::pair<Vst2Logger&, bool>(logger, true),
|
converter, std::pair<Vst2Logger&, bool>(logger, true),
|
||||||
opcode, index, value, data, option);
|
opcode, index, value, data, option);
|
||||||
} catch (const boost::system::system_error& a) {
|
} catch (const boost::system::system_error&) {
|
||||||
// Thrown when the socket gets closed because the VST plugin
|
// Thrown when the socket gets closed because the VST plugin
|
||||||
// loaded into the Wine process crashed during shutdown
|
// loaded into the Wine process crashed during shutdown
|
||||||
logger.log("The plugin crashed during shutdown, ignoring");
|
logger.log("The plugin crashed during shutdown, ignoring");
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ Vst3PlugViewProxyImpl::setFrame(Steinberg::IPlugFrame* frame) {
|
|||||||
// try to call those functions from an `IRunLoop` event handler.
|
// try to call those functions from an `IRunLoop` event handler.
|
||||||
try {
|
try {
|
||||||
run_loop_tasks.emplace(plug_frame);
|
run_loop_tasks.emplace(plug_frame);
|
||||||
} catch (const std::runtime_error& e) {
|
} catch (const std::runtime_error& error) {
|
||||||
// In case the host does not support `IRunLoop` or if we can't
|
// In case the host does not support `IRunLoop` or if we can't
|
||||||
// register an event handler, we'll throw during `RunLoopTasks`'
|
// register an event handler, we'll throw during `RunLoopTasks`'
|
||||||
// constructor
|
// constructor
|
||||||
@@ -226,7 +226,7 @@ Vst3PlugViewProxyImpl::setFrame(Steinberg::IPlugFrame* frame) {
|
|||||||
bridge.logger.log(
|
bridge.logger.log(
|
||||||
"The host does not support IRunLoop, falling back to naive GUI "
|
"The host does not support IRunLoop, falling back to naive GUI "
|
||||||
"function execution: " +
|
"function execution: " +
|
||||||
std::string(e.what()));
|
std::string(error.what()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return bridge.send_mutually_recursive_message(YaPlugView::SetFrame{
|
return bridge.send_mutually_recursive_message(YaPlugView::SetFrame{
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ boost::asio::local::stream_protocol::acceptor create_acceptor_if_inactive(
|
|||||||
try {
|
try {
|
||||||
return boost::asio::local::stream_protocol::acceptor(io_context,
|
return boost::asio::local::stream_protocol::acceptor(io_context,
|
||||||
endpoint);
|
endpoint);
|
||||||
} catch (const boost::system::system_error& error) {
|
} catch (const boost::system::system_error&) {
|
||||||
// If this failed, then either there is a stale socket file or another
|
// If this failed, then either there is a stale socket file or another
|
||||||
// process is already is already listening. In the last case we will
|
// process is already is already listening. In the last case we will
|
||||||
// simply throw so the other process can handle the request.
|
// simply throw so the other process can handle the request.
|
||||||
@@ -301,7 +301,7 @@ boost::asio::local::stream_protocol::acceptor create_acceptor_if_inactive(
|
|||||||
if (file == endpoint_path) {
|
if (file == endpoint_path) {
|
||||||
// Another process is already listening, so we don't have to do
|
// Another process is already listening, so we don't have to do
|
||||||
// anything
|
// anything
|
||||||
throw error;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user