diff options
author | Russell Sim <russell.sim@gmail.com> | 2020-06-14 09:07:27 +0200 |
---|---|---|
committer | Russell Sim <russell.sim@gmail.com> | 2020-06-14 09:08:35 +0200 |
commit | 8444c609936606a361dd2681a6e2356e0d5ee81c (patch) | |
tree | ddd8bee7bc99015b1470fce1cca8f2cf54736951 /proto-wine/ftnoir_protocol_wine.cpp | |
parent | beac0c60e8188cb593ac82df2c0773576b493c93 (diff) |
Implement error handling
Diffstat (limited to 'proto-wine/ftnoir_protocol_wine.cpp')
-rw-r--r-- | proto-wine/ftnoir_protocol_wine.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index 63308e9f..7052ea41 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -1,4 +1,5 @@ #include "ftnoir_protocol_wine.h" +#include "proton.h" #ifndef OTR_WINE_NO_WRAPPER # include "csv/csv.h" #endif @@ -74,9 +75,13 @@ module_status wine::initialize() QString proton_path(const QString& proton_path); wine_path = proton_path(s.proton_path().toString()); - env = make_steam_environ(s.proton_path().toString(), s.proton_appid); + try { + env = make_steam_environ(s.proton_path().toString(), s.proton_appid); + } catch(const ProtonException &e) { + return error(e.getMessage()); + } } - else + { QString wineprefix = "~/.wine"; if (!s.wineprefix->isEmpty()) @@ -85,7 +90,7 @@ module_status wine::initialize() wineprefix = qgetenv("HOME") + wineprefix.mid(1); if (wineprefix[0] != '/') - error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix)); + return error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix)); env.insert("WINEPREFIX", wineprefix); } |