mirror of https://github.com/Qiskit/qiskit.git
added top level make, added specific error message for incorrect file name
This commit is contained in:
parent
443fe3895b
commit
6700afebb4
4
Makefile
4
Makefile
|
@ -47,6 +47,10 @@ doc:
|
|||
make -C doc -e BUILDDIR="_build/$$LANGUAGE" -e SOURCEDIR="./$$LANGUAGE" html; \
|
||||
done
|
||||
|
||||
sim:
|
||||
make -C external/cpp-simulator/src clean
|
||||
make -C external/cpp-simulator/src
|
||||
|
||||
clean:
|
||||
make -C doc clean
|
||||
make -C doc -e BUILDDIR="_build/ja" -e SOURCEDIR="./ja" clean
|
||||
|
|
|
@ -94,7 +94,7 @@ json_t Simulator::execute() {
|
|||
std::chrono::time_point<myclock_t> start = myclock_t::now(); // start timer
|
||||
json_t ret;
|
||||
ret["id"] = id;
|
||||
if (simulator == 'clifford')
|
||||
if (simulator == "clifford")
|
||||
ret["backend"] = std::string("local_clifford_simulator");
|
||||
else
|
||||
ret["backend"] = std::string("local_qiskit_simulator");
|
||||
|
|
|
@ -391,7 +391,13 @@ json_t JSON::load(std::string name) {
|
|||
// auto js = json::parse(read_stream(std::cin));
|
||||
std::cin >> js;
|
||||
else { // Load from file
|
||||
std::ifstream ifile(name);
|
||||
std::ifstream ifile;
|
||||
ifile.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
try {
|
||||
ifile.open(name);
|
||||
} catch (std::system_error &e) {
|
||||
throw std::runtime_error(std::string("no such file or directory"));
|
||||
}
|
||||
ifile >> js;
|
||||
}
|
||||
return js;
|
||||
|
|
Loading…
Reference in New Issue