View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002827 | OpenFOAM | Patch | public | 2018-02-06 11:15 | 2018-02-06 11:49 |
Reporter | sigveka | Assigned To | henry | ||
Priority | low | Severity | trivial | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Platform | Latitude E7450, Intel i7-5600U | OS | Pop!_OS (Ubuntu derived) | OS Version | 17.10 |
Fixed in Version | dev | ||||
Summary | 0002827: Fix possibility of exiting OpenFOAM with any integer error code. | ||||
Description | While attempting to exit FOAM with a specific exit code (integer) I noticed that the resulting error code is always "1" (running in serial mode). Looking at line 203 of error.C this is obvious because the error code is hard-coded to be 1. | ||||
Steps To Reproduce | Make a copy of an existing solver, e.g. "laplacianFoam" and a tutorial mkdir "${HOME}/Desktop/foamExit"; cd "${HOME}/Desktop/foamExit" cp -r "${FOAM_SOLVERS}/basic/laplacianFoam" "errLaplacianFoam" cp -r "${FOAM_TUTORIALS}/basic/laplacianFoam/flange" . Paste the lines below in the main function of the solver and edit the name of the produced executable to "errLaplacianFoam". Foam::error e("My error"); e.exit(100); Compile the modified solver, run the example (flage) as follows (the last line prints the exit code): ansysToFoam flange.ans errSimpleFoam echo $? | ||||
Additional Information | The source of this behavior is clearly seen in line 203 of "error.C". | ||||
Tags | Exception handling | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2018-02-06 11:15 | sigveka | New Issue | |
2018-02-06 11:15 | sigveka | Tag Attached: Exception handling | |
2018-02-06 11:49 | henry | Assigned To | => henry |
2018-02-06 11:49 | henry | Status | new => resolved |
2018-02-06 11:49 | henry | Resolution | open => fixed |
2018-02-06 11:49 | henry | Fixed in Version | => dev |
2018-02-06 11:49 | henry | Note Added: 0009265 |