surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.01k stars 385 forks source link

Add failsafe to OSC save patch to user patch dir #7617

Closed gitsmol closed 2 months ago

gitsmol commented 2 months ago

Trying again after some clang formatting fails...

baconpaul commented 2 months ago

There are cases where this operation can throw an fs::filesystem_error which uncaught here would crash your OSC instance.

You probably want

try {
   /// your code here
} catch (const fs::filesystem_error &e)
{
  // report e.what()
}

to be safe