Skip to content

Commit

Permalink
MAINT: Cleanup and propagate correct exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Aug 5, 2023
1 parent 4256875 commit 31d630f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Highs.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "lp_data/HighsRanging.h"
#include "lp_data/HighsSolutionDebug.h"
#include "model/HighsModel.h"
#include "util/HighsExceptions.h"
#include "presolve/ICrash.h"
#include "presolve/PresolveComponent.h"

Expand Down
4 changes: 1 addition & 3 deletions src/presolve/HPresolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3997,10 +3997,8 @@ HPresolve::Result HPresolve::presolve(HighsPostsolveStack& postsolve_stack) {
try {
HPRESOLVE_CHECKED_CALL(initialRowAndColPresolve(postsolve_stack));
} catch (const DataStackOverflow& e) {
highsLogUser(options->log_options, HighsLogType::kInfo,
"Problem is too large to be presolved\n");
// Here we re-throw the error
throw;
throw PresolveTooLarge(e.what());
}

HighsInt numParallelRowColCalls = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/presolve/HighsPostsolveStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class HighsPostsolveStack {
reductionAdded(ReductionType::kFixedCol);
} catch (const DataStackOverflow& e) {
std::cerr << "Memory allocation failed while processing fixedColAtLower: "
<< e.what() << std::endl;
<< std::endl;
// Rethrow.
throw;
}
Expand Down

0 comments on commit 31d630f

Please sign in to comment.