From c4ddbe1b595d2ff9fe9a5eed69569009673ee8b3 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs@hunt.opencfd.co.uk> Date: Tue, 10 Feb 2009 14:33:43 +0000 Subject: [PATCH] improved error message --- .../general/findRefCell/findRefCell.C | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C b/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C index 3572bcb6d05..19268899553 100644 --- a/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C +++ b/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C @@ -52,18 +52,19 @@ void Foam::setRefCell if (refCelli < 0 || refCelli >= field.mesh().nCells()) { - FatalErrorIn + FatalIOErrorIn ( - "void Foam::setRefCell" - "(" - " const volScalarField&," - " const dictionary&," - " label& scalar&," - " bool" - ")" + "void Foam::setRefCell\n" + "(\n" + " const volScalarField&,\n" + " const dictionary&,\n" + " label& scalar&,\n" + " bool\n" + ")", + dict ) << "Illegal master cellID " << refCelli << ". Should be 0.." << field.mesh().nCells() - << exit(FatalError); + << exit(FatalIOError); } } else @@ -79,36 +80,38 @@ void Foam::setRefCell label sumHasRef = returnReduce<label>(hasRef, sumOp<label>()); if (sumHasRef != 1) { - FatalErrorIn + FatalIOErrorIn ( - "void Foam::setRefCell" - "(" - " const volScalarField&," - " const dictionary&," - " label& scalar&," - " bool" - ")" + "void Foam::setRefCell\n" + "(\n" + " const volScalarField&,\n" + " const dictionary&,\n" + " label& scalar&,\n" + " bool\n" + ")", + dict ) << "Unable to set reference cell for field " << field.name() << nl << " Reference point " << refPointName - << " found on multiple domains" << nl << exit(FatalError); + << " found on multiple domains" << nl << exit(FatalIOError); } } else { - FatalErrorIn + FatalIOErrorIn ( - "void Foam::setRefCell" - "(" - " const volScalarField&," - " const dictionary&," - " label& scalar&," - " bool" - ")" + "void Foam::setRefCell\n" + "(\n" + " const volScalarField&,\n" + " const dictionary&,\n" + " label& scalar&,\n" + " bool\n" + ")", + dict ) << "Unable to set reference cell for field" << field.name() << nl << " Please supply either " << refCellName - << " or " << refPointName << nl << exit(FatalError); + << " or " << refPointName << nl << exit(FatalIOError); } refValue = readScalar(dict.lookup(refValueName)); -- GitLab