Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix catching by value #3077

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/api_cc/src/DeepPot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void DeepPot::init(const std::string& model,
ntypes = get_scalar<int>("descrpt_attr/ntypes");
try {
ntypes_spin = get_scalar<int>("spin_attr/ntypes_spin");
} catch (deepmd::deepmd_exception) {
} catch (const deepmd::deepmd_exception) {
ntypes_spin = 0;
}
dfparam = get_scalar<int>("fitting_attr/dfparam");
Expand All @@ -488,7 +488,7 @@ void DeepPot::init(const std::string& model,
if (daparam > 0) {
try {
aparam_nall = get_scalar<bool>("fitting_attr/aparam_nall");
} catch (deepmd::deepmd_exception) {
} catch (const deepmd::deepmd_exception) {
aparam_nall = false;
}
} else {
Expand Down Expand Up @@ -1331,7 +1331,7 @@ void DeepPotModelDevi::init(const std::vector<std::string>& models,
ntypes = get_scalar<int>("descrpt_attr/ntypes");
try {
ntypes_spin = get_scalar<int>("spin_attr/ntypes_spin");
} catch (deepmd::deepmd_exception) {
} catch (const deepmd::deepmd_exception) {
ntypes_spin = 0;
}
dfparam = get_scalar<int>("fitting_attr/dfparam");
Expand All @@ -1345,7 +1345,7 @@ void DeepPotModelDevi::init(const std::vector<std::string>& models,
if (daparam > 0) {
try {
aparam_nall = get_scalar<bool>("fitting_attr/aparam_nall");
} catch (deepmd::deepmd_exception) {
} catch (const deepmd::deepmd_exception) {
aparam_nall = false;
}
} else {
Expand Down
Loading