server/state: throw interface::TargetModuleNotAvailable instead of Exception
This commit is contained in:
parent
7e80e34cc6
commit
ff01b1fcce
@ -50,12 +50,11 @@ namespace interface
|
|||||||
ModuleUnloadedEvent(const ss_ &name): name(name){}
|
ModuleUnloadedEvent(const ss_ &name): name(name){}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*// Occurs when trying to access a module using access_module(), but it has
|
// Occurs when trying to access a module using access_module(), but it has
|
||||||
// been stopped (and possibly deleted)
|
// been stopped (and possibly deleted)
|
||||||
struct TargetModuleStopped: public Exception {
|
struct TargetModuleNotAvailable: public Exception {
|
||||||
ss_ msg;
|
TargetModuleNotAvailable(const ss_ &msg): Exception(msg){}
|
||||||
TargetModuleStopped(const ss_ &msg): Exception(msg){}
|
};
|
||||||
};*/
|
|
||||||
|
|
||||||
struct Server
|
struct Server
|
||||||
{
|
{
|
||||||
|
@ -193,17 +193,8 @@ struct ModuleContainer
|
|||||||
// Return an exception to make sure the caller doesn't continue
|
// Return an exception to make sure the caller doesn't continue
|
||||||
// without knowing what it's doing
|
// without knowing what it's doing
|
||||||
ss_ caller_name = caller_mc ? caller_mc->info.name : "__unknown";
|
ss_ caller_name = caller_mc ? caller_mc->info.name : "__unknown";
|
||||||
/*try {
|
throw interface::TargetModuleNotAvailable(
|
||||||
// TODO: Use a more specific exception
|
"Target module ["+info.name+"] is stopping - "
|
||||||
throw Exception("Target module ["+info.name+"] is stopping"
|
|
||||||
" - called by ["+caller_name+"]");
|
|
||||||
} catch(...){
|
|
||||||
// Return it the exception this way so that the caller can
|
|
||||||
// record the backtrace
|
|
||||||
result_exception = std::current_exception();
|
|
||||||
}
|
|
||||||
return;*/
|
|
||||||
throw Exception("Target module ["+info.name+"] is stopping - "
|
|
||||||
"called by ["+caller_name+"]");
|
"called by ["+caller_name+"]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,10 @@ namespace interface
|
|||||||
namespace server
|
namespace server
|
||||||
{
|
{
|
||||||
struct ServerShutdownRequest: public Exception {
|
struct ServerShutdownRequest: public Exception {
|
||||||
ss_ msg;
|
|
||||||
ServerShutdownRequest(const ss_ &msg): Exception(msg){}
|
ServerShutdownRequest(const ss_ &msg): Exception(msg){}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ModuleNotFoundException: public Exception {
|
struct ModuleNotFoundException: public Exception {
|
||||||
ss_ msg;
|
|
||||||
ModuleNotFoundException(const ss_ &msg): Exception(msg){}
|
ModuleNotFoundException(const ss_ &msg): Exception(msg){}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user