I have enum for errors for instance:

Code:
enum socket_errors {
	ERR_UNRESOLVABLE = SOCKET_ERRORS,
	ERR_INTERNAL,
	ERR_SOCK_CREATION,
	ERR_BIND_FAILED
};
And when I want to throw in some function this way:

Code:
void prevfunc() {
    //stuff//
    throw ERR_SOCK_CREATION;
    return;
}
I cannot catch this way in some other function that is calling previous function:
Code:
try {
     prevfunc();
}
catch (unsigned int) {
}
What would be the right way to catch it? What should I look for?