MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / main

Function main

examples/isolated/setting_errorhandler.cpp:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48int main() {
49 initQuESTEnv();
50
51 setInputErrorHandler(myErrorHandlerA);
52
53 try {
54 Qureg qureg = createQureg(-123);
55 } catch (std::runtime_error& e) {
56 std::cout
57 << "Error caught! Function aborted, but execution continues."
58 << std::endl
59 << std::endl;
60 }
61
62 setInputErrorHandler(myErrorHandlerB);
63 initQuESTEnv(); // illegal to recall
64
65 std::cout << "this will never be reached, because myErrorHandlerB exits!" << std::endl;
66
67 finalizeQuESTEnv();
68}

Callers

nothing calls this directly

Calls 4

initQuESTEnvFunction · 0.85
setInputErrorHandlerFunction · 0.85
createQuregFunction · 0.85
finalizeQuESTEnvFunction · 0.85

Tested by

no test coverage detected