Skip to content

Commit

Permalink
Add different return values
Browse files Browse the repository at this point in the history
  • Loading branch information
aarikpokras authored Dec 2, 2024
1 parent d36bb42 commit 0843bf4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ int main(int argc, char *argv[]) {
amt_ = stoi(amt__);
} catch (invalid_argument& err) {
cerr << "Error in " << err.what() << ", is amt an integer?" << endl;
return 1;
return 4;
} // catch
} // else
} // amt
} // arg checker
vector<string> out_x = gval_aml(key_, fil_, amt_);
if (out_x[0] == "err") {
cerr << "Error: the file could not be opened." << endl;
return 1;
return 2;
} else if (out_x[0] == "key_err") {
cerr << "Error: the specified key " << key_ << " does not exist." << endl;
return 1;
return 2;
} else {
for (size_t i = 0; i < out_x.size(); i++) {
cout << out_x[i] << delim;
Expand Down

0 comments on commit 0843bf4

Please sign in to comment.