Skip to content
Snippets Groups Projects
Commit 1beb363f authored by Clara Daia Hilgenberg Daru's avatar Clara Daia Hilgenberg Daru
Browse files

Correct error message type

parent 1b94f214
No related branches found
No related tags found
1 merge request!51Merge development to master
......@@ -62,7 +62,7 @@ std::string get_distro() {
}
}
throw "Release file empty or incomplete.";
throw std::string("Release file empty or incomplete.");
// openSuSE
} else if (open_file("/etc/os-release", release_file)) {
......@@ -102,7 +102,7 @@ std::string get_distro() {
if (name.length())
return name;
throw "Release file empty or incomplete.";
throw std::string("Release file empty or incomplete.");
} else if (open_file("/etc/novell-release", release_file)) {
......@@ -111,7 +111,7 @@ std::string get_distro() {
if (line.length())
return line;
throw "Release file empty.";
throw std::string("Release file empty.");
} else if (open_file("/etc/sles-release", release_file)) {
......@@ -120,7 +120,7 @@ std::string get_distro() {
if (line.length())
return line;
throw "Release file empty.";
throw std::string("Release file empty.");
// fedora
} else if (open_file("/etc/redhat-release", release_file)) {
......@@ -130,7 +130,7 @@ std::string get_distro() {
if (line.length())
return line;
throw "Release file empty.";
throw std::string("Release file empty.");
// debian -- leave this at the end, otherwise debian-based distros
// will find the debian_version file instead of the actual
......@@ -142,7 +142,7 @@ std::string get_distro() {
if (line.length())
return line;
throw "Release file empty.";
throw std::string("Release file empty.");
} else if (open_file("/etc/debian-version", release_file)) {
......@@ -151,9 +151,9 @@ std::string get_distro() {
if (line.length())
return line;
throw "Release file empty.";
throw std::string("Release file empty.");
}
throw "No release file found.";
throw std::string("No release file found.");
}
......@@ -31,7 +31,7 @@ std::string get_macaddr() {
if (!file.is_open()) {
file.open("/sys/class/net/eth1/address", std::ifstream::in);
if (!file.is_open()) {
throw "No address file found.";
throw std::string("No address file found.");
}
}
......
......@@ -432,7 +432,7 @@ static struct user_log * last_modified() {
p = (struct utmplist *)malloc(sizeof(struct utmplist));
if (p == NULL) {
throw "ERROR: out of memory";
throw std::string("ERROR: out of memory");
}
memcpy(&p->ut, &ut, sizeof(struct utmp));
......@@ -550,7 +550,7 @@ static struct user_log * last_modified() {
break;
p = (struct utmplist *)malloc(sizeof(struct utmplist));
if (p == NULL) {
throw "ERROR: out of memory";
throw std::string("ERROR: out of memory");
}
memcpy(&p->ut, &ut, sizeof(struct utmp));
p->next = utmplist;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment