mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-24 08:44:44 +01:00
Fix exceptions referenced in #1287
This commit is contained in:
parent
159f59b858
commit
27ab5bf3c1
@ -88,7 +88,7 @@ int CommandArgsParser::parse(int argc, char* argv[]) {
|
|||||||
try {
|
try {
|
||||||
carg.ival = std::stoi(arg);
|
carg.ival = std::stoi(arg);
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
printf("Invalid argument, failed to parse integer\n");
|
printf("Invalid argument, failed to parse integer\n");
|
||||||
showHelp();
|
showHelp();
|
||||||
return -1;
|
return -1;
|
||||||
@ -98,7 +98,7 @@ int CommandArgsParser::parse(int argc, char* argv[]) {
|
|||||||
try {
|
try {
|
||||||
carg.fval = std::stod(arg);
|
carg.fval = std::stod(arg);
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
printf("Invalid argument, failed to parse float\n");
|
printf("Invalid argument, failed to parse float\n");
|
||||||
showHelp();
|
showHelp();
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -36,8 +36,8 @@ void ConfigManager::load(json def, bool lock) {
|
|||||||
file >> conf;
|
file >> conf;
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Config file '{0}' is corrupted, resetting it", path);
|
flog::error("Config file '{}' is corrupted, resetting it: {}", path, e.what());
|
||||||
conf = def;
|
conf = def;
|
||||||
save(false);
|
save(false);
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ namespace net {
|
|||||||
}
|
}
|
||||||
entry.handler(std::move(client), entry.ctx);
|
entry.handler(std::move(client), entry.ctx);
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
listening = false;
|
listening = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,8 @@ public:
|
|||||||
try {
|
try {
|
||||||
client = net::rigctl::connect(host, port);
|
client = net::rigctl::connect(host, port);
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Could not connect: {0}", e.what());
|
flog::error("Could not connect: {}", e.what());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,8 +200,8 @@ private:
|
|||||||
listener = net::listen(hostname, port);
|
listener = net::listen(hostname, port);
|
||||||
listener->acceptAsync(clientHandler, this);
|
listener->acceptAsync(clientHandler, this);
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Could not start rigctl server: {0}", e.what());
|
flog::error("Could not start rigctl server: {}", e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,10 +141,10 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf, "%016" PRIX64, serial);
|
sprintf(buf, "%016" PRIX64, serial);
|
||||||
flog::error("Could not open Airspy {0}", buf);
|
flog::error("Could not open Airspy {}", buf);
|
||||||
}
|
}
|
||||||
selectedSerial = serial;
|
selectedSerial = serial;
|
||||||
|
|
||||||
|
@ -144,10 +144,10 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf, "%016" PRIX64, serial);
|
sprintf(buf, "%016" PRIX64, serial);
|
||||||
flog::error("Could not open Airspy HF+ {0}", buf);
|
flog::error("Could not open Airspy HF+ {}", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedSerial = serial;
|
selectedSerial = serial;
|
||||||
|
@ -200,11 +200,11 @@ private:
|
|||||||
_this->audio.startStream();
|
_this->audio.startStream();
|
||||||
_this->running = true;
|
_this->running = true;
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Error opening audio device: {0}", e.what());
|
flog::error("Error opening audio device: {}", e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
flog::info("AudioSourceModule '{0}': Start!", _this->name);
|
flog::info("AudioSourceModule '{}': Start!", _this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stop(void* ctx) {
|
static void stop(void* ctx) {
|
||||||
|
@ -139,8 +139,8 @@ private:
|
|||||||
//gui::freqSelect.maxFreq = _this->centerFreq + (_this->sampleRate/2);
|
//gui::freqSelect.maxFreq = _this->centerFreq + (_this->sampleRate/2);
|
||||||
//gui::freqSelect.limitFreq = true;
|
//gui::freqSelect.limitFreq = true;
|
||||||
}
|
}
|
||||||
catch (std::exception& e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Error: {0}", e.what());
|
flog::error("Error: {}", e.what());
|
||||||
}
|
}
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["path"] = _this->fileSelect.path;
|
config.conf["path"] = _this->fileSelect.path;
|
||||||
|
@ -154,8 +154,8 @@ private:
|
|||||||
_this->client = rfspace::connect(_this->hostname, _this->port, &_this->stream);
|
_this->client = rfspace::connect(_this->hostname, _this->port, &_this->stream);
|
||||||
_this->deviceInit();
|
_this->deviceInit();
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Could not connect to SDR: {0}", e.what());
|
flog::error("Could not connect to SDR: {}", e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (connected && SmGui::Button("Disconnect##rfspace_source")) {
|
else if (connected && SmGui::Button("Disconnect##rfspace_source")) {
|
||||||
|
@ -132,8 +132,8 @@ private:
|
|||||||
try {
|
try {
|
||||||
_this->client = rtltcp::connect(&_this->stream, _this->ip, _this->port);
|
_this->client = rtltcp::connect(&_this->stream, _this->ip, _this->port);
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Could connect to RTL-TCP server: {0}", e.what());
|
flog::error("Could connect to RTL-TCP server: {}", e.what());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,8 +233,8 @@ private:
|
|||||||
client = server::connect(hostname, port, &stream);
|
client = server::connect(hostname, port, &stream);
|
||||||
deviceInit();
|
deviceInit();
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Could not connect to SDR: {0}", e.what());
|
flog::error("Could not connect to SDR: {}", e.what());
|
||||||
if (!strcmp(e.what(), "Server busy")) { serverBusy = true; }
|
if (!strcmp(e.what(), "Server busy")) { serverBusy = true; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -283,8 +283,8 @@ private:
|
|||||||
flog::info("Connected to server");
|
flog::info("Connected to server");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception e) {
|
catch (const std::exception& e) {
|
||||||
flog::error("Could not connect to spyserver {0}", e.what());
|
flog::error("Could not connect to spyserver {}", e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user