auto& resAttrs = resObject->getAttributes();
for (const auto& kv : requestedAttrs)
{
- if (resAttrs.contains(kv.key())) resAttrs[kv.key()] = kv.value();
+ if (resAttrs.contains(kv.key()))
+ {
+ resAttrs[kv.key()] = kv.value();
+ }
}
}
{
assert(min <= max);
- int input;
+ int input = 0;
while(true)
{
if (!std::cin.fail())
{
- if(min <= input && input <= max) return input;
+ if(min <= input && input <= max)
+ {
+ return input;
+ }
}
std::cin.clear();
int main(void)
{
- selectResourceType();
+ try
+ {
+ selectResourceType();
+ }
+ catch(...)
+ {
+ std::cout << "Can't select Resource Type" << std::endl;
+ return -1;
+ }
std::cout << "Resource successfully created!" << std::endl;