| 207 | |
| 208 | |
| 209 | void Foam::error::abort() |
| 210 | { |
| 211 | if (!throwExceptions_ && JobInfo::constructed) |
| 212 | { |
| 213 | jobInfo.add("FatalError", operator dictionary()); |
| 214 | jobInfo.abort(); |
| 215 | } |
| 216 | |
| 217 | if (abort_) |
| 218 | { |
| 219 | Perr<< endl << *this << endl |
| 220 | << "\nFOAM aborting (FOAM_ABORT set)\n" << endl; |
| 221 | printStack(Perr); |
| 222 | ::abort(); |
| 223 | } |
| 224 | |
| 225 | if (Pstream::parRun()) |
| 226 | { |
| 227 | Perr<< endl << *this << endl |
| 228 | << "\nFOAM parallel run aborting\n" << endl; |
| 229 | printStack(Perr); |
| 230 | Pstream::abort(); |
| 231 | } |
| 232 | else |
| 233 | { |
| 234 | if (throwExceptions_) |
| 235 | { |
| 236 | // Make a copy of the error to throw |
| 237 | error errorException(*this); |
| 238 | |
| 239 | // Rewind the message buffer for the next error message |
| 240 | messageStreamPtr_->rewind(); |
| 241 | |
| 242 | throw errorException; |
| 243 | } |
| 244 | else |
| 245 | { |
| 246 | Perr<< endl << *this << endl |
| 247 | << "\nFOAM aborting\n" << endl; |
| 248 | printStack(Perr); |
| 249 | ::abort(); |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | |
| 255 | Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr) |
no test coverage detected