Skip to content

Commit

Permalink
Use return() instead of exit()
Browse files Browse the repository at this point in the history
Previously, the function employed `exit()`, which, when invoked, results in the immediate termination of the entire program. In a library this is not a wanted response when handling errors, a better approach is to return an error code and let  the calling application handle the error.
  • Loading branch information
havardAasen authored and tkralphs committed Dec 20, 2023
1 parent ab0e72f commit 477c9cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Osi/OsiSolverInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ int OsiSolverInterface::writeLpNative(const char *filename,
if (!fp) {
printf("### ERROR: in OsiSolverInterface::writeLpNative(): unable to open file %s\n",
filename);
exit(1);
return (1);
}
int nerr = writeLpNative(fp, rowNames, columnNames,
epsilon, numberAcross, decimals,
Expand Down

0 comments on commit 477c9cd

Please sign in to comment.