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