#include <iostream>
#include <stdexcept>
#include <vector>
using namespace std;
void throwWhenNullOrEmpty(vector<int> list)
{
class IsEmptyException : exception { };
class NotEnoughException : exception { };
if (list.size() == 0) {
throw IsEmptyException();
}
if (list.size() < 10) {
throw NotEnoughException();
}
}
try {
throwWhenNullOrEmpty({1, 2, 3});
}
catch (...) {
cout << "Error happened";
}