MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / exit

Function exit

src/OpenFOAM/db/error/IOerror.C:171–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170
171void Foam::IOerror::exit(const int)
172{
173 if (!throwExceptions_ && JobInfo::constructed)
174 {
175 jobInfo.add("FatalIOError", operator dictionary());
176 jobInfo.exit();
177 }
178
179 if (abort_)
180 {
181 abort();
182 }
183
184 if (Pstream::parRun())
185 {
186 Perr<< endl << *this << endl
187 << "\nFOAM parallel run exiting\n" << endl;
188 Pstream::exit(1);
189 }
190 else
191 {
192 if (throwExceptions_)
193 {
194 // Make a copy of the error to throw
195 IOerror errorException(*this);
196
197 // Rewind the message buffer for the next error message
198 messageStreamPtr_->rewind();
199
200 throw errorException;
201 }
202 else
203 {
204 Perr<< endl << *this << endl
205 << "\nFOAM exiting\n" << endl;
206 ::exit(1);
207 }
208 }
209}
210
211
212void Foam::IOerror::abort()

Callers 1

SafeFatalIOErrorFunction · 0.70

Calls 4

dictionaryClass · 0.70
abortFunction · 0.70
addMethod · 0.45
rewindMethod · 0.45

Tested by

no test coverage detected