| 169 | |
| 170 | |
| 171 | void 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 | |
| 212 | void Foam::IOerror::abort() |
no test coverage detected