mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
refactor getID
This commit is contained in:
@ -19,43 +19,56 @@ using sls::SocketError;
|
||||
|
||||
int main() {
|
||||
|
||||
//Catch exception
|
||||
try {
|
||||
throw RuntimeError("something went wrong");
|
||||
} catch (RuntimeError &e) {
|
||||
std::cout << "Caught RuntimeError with message : " << e.what() << '\n';
|
||||
}
|
||||
|
||||
//Catch base class
|
||||
try {
|
||||
throw SharedMemoryError("Could not create shared memory");
|
||||
} catch (RuntimeError &e) {
|
||||
std::cout << "Caught: " << e.what() << '\n';
|
||||
}
|
||||
// const std::string hostname = "beb083";
|
||||
// auto type = slsDetector::getTypeFromDetector(hostname);
|
||||
// slsDetector d(type);
|
||||
// d.setHostname(hostname);
|
||||
// d.setReceiverHostname("mpc2408");
|
||||
// std::cout << "hostname: " << d.getHostname() << '\n';
|
||||
// std::cout << "port: " << d.getControlPort() << '\n';
|
||||
// d.setOnline(true);
|
||||
// d.setReceiverOnline(true);
|
||||
// std::cout << "reciver version: " << std::hex << d.getReceiverVersion() << '\n';
|
||||
// // std::cout << "version: " << d.getId(slsDetectorDefs::CLIENT_RECEIVER_API_VERSION) << '\n';
|
||||
// d.freeSharedMemory();
|
||||
// //Catch exception
|
||||
// try {
|
||||
// throw RuntimeError("something went wrong");
|
||||
// } catch (RuntimeError &e) {
|
||||
// std::cout << "Caught RuntimeError with message : " << e.what() << '\n';
|
||||
// }
|
||||
|
||||
//Catch base class after looking for something else
|
||||
try {
|
||||
throw SharedMemoryError("Could not create shared memory");
|
||||
} catch (SocketError &e) {
|
||||
// //Catch base class
|
||||
// try {
|
||||
// throw SharedMemoryError("Could not create shared memory");
|
||||
// } catch (RuntimeError &e) {
|
||||
// std::cout << "Caught: " << e.what() << '\n';
|
||||
// }
|
||||
|
||||
std::cout << "Caught Socket error: " << e.what() << '\n';
|
||||
// //Catch base class after looking for something else
|
||||
// try {
|
||||
// throw SharedMemoryError("Could not create shared memory");
|
||||
// } catch (SocketError &e) {
|
||||
|
||||
} catch (RuntimeError &e) {
|
||||
std::cout << "Caught base class: " << e.what() << '\n';
|
||||
}
|
||||
// std::cout << "Caught Socket error: " << e.what() << '\n';
|
||||
|
||||
//Catch any after looking for something else
|
||||
try {
|
||||
throw SharedMemoryError("Could not create shared memory");
|
||||
} catch (SocketError &e) {
|
||||
// } catch (RuntimeError &e) {
|
||||
// std::cout << "Caught base class: " << e.what() << '\n';
|
||||
// }
|
||||
|
||||
std::cout << "Caught Socket error: " << e.what() << '\n';
|
||||
// //Catch any after looking for something else
|
||||
// try {
|
||||
// throw SharedMemoryError("Could not create shared memory");
|
||||
// } catch (SocketError &e) {
|
||||
|
||||
} catch (...) {
|
||||
std::cout << "Caught Something else probably should have let me crash\n";
|
||||
}
|
||||
// std::cout << "Caught Socket error: " << e.what() << '\n';
|
||||
|
||||
// } catch (...) {
|
||||
// std::cout << "Caught Something else probably should have let me crash\n";
|
||||
// }
|
||||
|
||||
|
||||
throw RuntimeError("This one we missed");
|
||||
// throw RuntimeError("This one we missed");
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user