#include <iostream>
#include <memory>
#include <stdexcept>

class Resource {
public:
    void use(const char* N) {
        std::cout << "Using resource. Passed " << *N << '\n';
        if (*N == 'd') {
            throw std::logic_error("Passed d. d is prohibited.");
        }
    };
};

int main(int argc, char* argv[]) {
    if (argc != 2) {
        std::cerr << "You need to pass 1 argument" << '\n';
        exit(-1);
    }

    const char* arg = argv[1];
    std::unique_ptr<Resource> rsc;

    try {
        rsc = std::make_unique<Resource>();
        rsc->use(arg);
    } catch (std::logic_error& e) {
        
    }

    return 0;
}
