Fix exceptions referenced in #1287

pull/1292/head
AlexandreRouma 2024-01-22 19:46:01 +01:00
rodzic 159f59b858
commit 27ab5bf3c1
13 zmienionych plików z 26 dodań i 26 usunięć

Wyświetl plik

@ -88,7 +88,7 @@ int CommandArgsParser::parse(int argc, char* argv[]) {
try {
carg.ival = std::stoi(arg);
}
catch (std::exception e) {
catch (const std::exception& e) {
printf("Invalid argument, failed to parse integer\n");
showHelp();
return -1;
@ -98,7 +98,7 @@ int CommandArgsParser::parse(int argc, char* argv[]) {
try {
carg.fval = std::stod(arg);
}
catch (std::exception e) {
catch (const std::exception& e) {
printf("Invalid argument, failed to parse float\n");
showHelp();
return -1;

Wyświetl plik

@ -36,8 +36,8 @@ void ConfigManager::load(json def, bool lock) {
file >> conf;
file.close();
}
catch (std::exception e) {
flog::error("Config file '{0}' is corrupted, resetting it", path);
catch (const std::exception& e) {
flog::error("Config file '{}' is corrupted, resetting it: {}", path, e.what());
conf = def;
save(false);
}

Wyświetl plik

@ -320,7 +320,7 @@ namespace net {
}
entry.handler(std::move(client), entry.ctx);
}
catch (std::exception e) {
catch (const std::exception& e) {
listening = false;
return;
}

Wyświetl plik

@ -80,8 +80,8 @@ public:
try {
client = net::rigctl::connect(host, port);
}
catch (std::exception e) {
flog::error("Could not connect: {0}", e.what());
catch (const std::exception& e) {
flog::error("Could not connect: {}", e.what());
return;
}

Wyświetl plik

@ -200,8 +200,8 @@ private:
listener = net::listen(hostname, port);
listener->acceptAsync(clientHandler, this);
}
catch (std::exception e) {
flog::error("Could not start rigctl server: {0}", e.what());
catch (const std::exception& e) {
flog::error("Could not start rigctl server: {}", e.what());
}
}

Wyświetl plik

@ -141,10 +141,10 @@ public:
return;
}
}
catch (std::exception e) {
catch (const std::exception& e) {
char buf[1024];
sprintf(buf, "%016" PRIX64, serial);
flog::error("Could not open Airspy {0}", buf);
flog::error("Could not open Airspy {}", buf);
}
selectedSerial = serial;

Wyświetl plik

@ -144,10 +144,10 @@ public:
return;
}
}
catch (std::exception e) {
catch (const std::exception& e) {
char buf[1024];
sprintf(buf, "%016" PRIX64, serial);
flog::error("Could not open Airspy HF+ {0}", buf);
flog::error("Could not open Airspy HF+ {}", buf);
}
selectedSerial = serial;

Wyświetl plik

@ -200,11 +200,11 @@ private:
_this->audio.startStream();
_this->running = true;
}
catch (std::exception e) {
flog::error("Error opening audio device: {0}", e.what());
catch (const std::exception& e) {
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) {

Wyświetl plik

@ -139,8 +139,8 @@ private:
//gui::freqSelect.maxFreq = _this->centerFreq + (_this->sampleRate/2);
//gui::freqSelect.limitFreq = true;
}
catch (std::exception& e) {
flog::error("Error: {0}", e.what());
catch (const std::exception& e) {
flog::error("Error: {}", e.what());
}
config.acquire();
config.conf["path"] = _this->fileSelect.path;

Wyświetl plik

@ -154,8 +154,8 @@ private:
_this->client = rfspace::connect(_this->hostname, _this->port, &_this->stream);
_this->deviceInit();
}
catch (std::exception e) {
flog::error("Could not connect to SDR: {0}", e.what());
catch (const std::exception& e) {
flog::error("Could not connect to SDR: {}", e.what());
}
}
else if (connected && SmGui::Button("Disconnect##rfspace_source")) {

Wyświetl plik

@ -132,8 +132,8 @@ private:
try {
_this->client = rtltcp::connect(&_this->stream, _this->ip, _this->port);
}
catch (std::exception e) {
flog::error("Could connect to RTL-TCP server: {0}", e.what());
catch (const std::exception& e) {
flog::error("Could connect to RTL-TCP server: {}", e.what());
return;
}

Wyświetl plik

@ -233,8 +233,8 @@ private:
client = server::connect(hostname, port, &stream);
deviceInit();
}
catch (std::exception e) {
flog::error("Could not connect to SDR: {0}", e.what());
catch (const std::exception& e) {
flog::error("Could not connect to SDR: {}", e.what());
if (!strcmp(e.what(), "Server busy")) { serverBusy = true; }
}
}

Wyświetl plik

@ -283,8 +283,8 @@ private:
flog::info("Connected to server");
}
}
catch (std::exception e) {
flog::error("Could not connect to spyserver {0}", e.what());
catch (const std::exception& e) {
flog::error("Could not connect to spyserver {}", e.what());
}
}