diff --git a/applications/test/faces/Test-faces.C b/applications/test/faces/Test-faces.C
index 823f33e3e10046f8836158180c2d22f033b855f1..280cdf70069dcf59656e1fa355dbe3a90884ebd4 100644
--- a/applications/test/faces/Test-faces.C
+++ b/applications/test/faces/Test-faces.C
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
     Info<< "face:" << f1 << nl;
 
     // expect these to fail
-    FatalError.throwExceptions();
+    const bool throwingError = FatalError.throwExceptions();
     try
     {
         labelledTri l1{ 1, 2, 3, 10, 24 };
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
         WarningInFunction
             << "Caught FatalError " << err << nl << endl;
     }
-    FatalError.dontThrowExceptions();
+    FatalError.throwExceptions(throwingError);
 
     labelledTri l2{ 1, 2, 3 };
     Info<< "labelled:" << l2 << nl;
diff --git a/applications/utilities/postProcessing/postProcess/postProcess.C b/applications/utilities/postProcessing/postProcess/postProcess.C
index 3f7f51dd2d4d2998b2bad374fadf5f3064c9192d..8a01c21eb44bdccf327297c0ea0475c388d01d12 100644
--- a/applications/utilities/postProcessing/postProcess/postProcess.C
+++ b/applications/utilities/postProcessing/postProcess/postProcess.C
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
             );
         }
 
-        FatalIOError.throwExceptions();
+        const bool throwingIOErr = FatalIOError.throwExceptions();
 
         try
         {
@@ -208,12 +208,15 @@ int main(int argc, char *argv[])
             // Report to output (avoid overwriting values from simulation)
             profiling::print(Info);
         }
-        catch (IOerror& err)
+        catch (Foam::IOerror& err)
         {
             Warning<< err << endl;
         }
 
         Info<< endl;
+
+        // Restore previous exception throwing state
+        FatalIOError.throwExceptions(throwingIOErr);
     }
 
     Info<< "End\n" << endl;
diff --git a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C
index 7d639e7b5cb6014e54382458c32cb4c67bfdb3dd..3147e59380e4ddeb68c5bf7cfbb54fb9063dd2c1 100644
--- a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C
+++ b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C
@@ -65,7 +65,7 @@ bool Foam::IOobject::readHeader(Istream& is)
      && firstToken.wordToken() == "FoamFile"
     )
     {
-        dictionary headerDict(is);
+        const dictionary headerDict(is);
 
         is.version(headerDict.lookup("version"));
         is.format(headerDict.lookup("format"));
diff --git a/src/OpenFOAM/db/error/IOerror.C b/src/OpenFOAM/db/error/IOerror.C
index 4e2fab2e0e87ee69f71566b229b37c35c1537c83..4ddaa2473ff46383073ef8bb0f411f70a40cb81a 100644
--- a/src/OpenFOAM/db/error/IOerror.C
+++ b/src/OpenFOAM/db/error/IOerror.C
@@ -30,7 +30,7 @@ License
 #include "JobInfo.H"
 #include "Pstream.H"
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::IOerror::IOerror(const string& title)
 :
@@ -50,10 +50,14 @@ Foam::IOerror::IOerror(const dictionary& errDict)
 {}
 
 
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
 Foam::IOerror::~IOerror() throw()
 {}
 
 
+// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
+
 Foam::OSstream& Foam::IOerror::operator()
 (
     const char* functionName,
@@ -167,6 +171,8 @@ Foam::IOerror::operator Foam::dictionary() const
 }
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
 void Foam::IOerror::exit(const int)
 {
     if (!throwExceptions_ && JobInfo::constructed)
@@ -254,32 +260,32 @@ void Foam::IOerror::abort()
 }
 
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
+Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& err)
 {
     if (!os.bad())
     {
-        os  << endl
-            << ioErr.title().c_str() << endl
-            << ioErr.message().c_str() << endl << endl;
+        os  << nl
+            << err.title().c_str() << nl
+            << err.message().c_str() << nl << endl;
 
-        os  << "file: " << ioErr.ioFileName().c_str();
+        os  << "file: " << err.ioFileName().c_str();
 
-        if (ioErr.ioStartLineNumber() >= 0 && ioErr.ioEndLineNumber() >= 0)
+        if (err.ioStartLineNumber() >= 0 && err.ioEndLineNumber() >= 0)
         {
-            os  << " from line " << ioErr.ioStartLineNumber()
-                << " to line " << ioErr.ioEndLineNumber() << '.';
+            os  << " from line " << err.ioStartLineNumber()
+                << " to line " << err.ioEndLineNumber() << '.';
         }
-        else if (ioErr.ioStartLineNumber() >= 0)
+        else if (err.ioStartLineNumber() >= 0)
         {
-            os  << " at line " << ioErr.ioStartLineNumber() << '.';
+            os  << " at line " << err.ioStartLineNumber() << '.';
         }
 
-        if (IOerror::level >= 2 && ioErr.sourceFileLineNumber())
+        if (IOerror::level >= 2 && err.sourceFileLineNumber())
         {
-            os  << endl << endl
-                << "    From function " << ioErr.functionName().c_str() << endl
-                << "    in file " << ioErr.sourceFileName().c_str()
-                << " at line " << ioErr.sourceFileLineNumber() << '.';
+            os  << nl << nl
+                << "    From function " << err.functionName().c_str() << endl
+                << "    in file " << err.sourceFileName().c_str()
+                << " at line " << err.sourceFileLineNumber() << '.';
         }
     }
 
@@ -292,4 +298,5 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
 
 Foam::IOerror Foam::FatalIOError("--> FOAM FATAL IO ERROR: ");
 
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/error/error.C b/src/OpenFOAM/db/error/error.C
index e0dbff97d8c7b9f8226ee0cadf421a96b7bec357..cc0907d2221e9434c695a9f0435fb1206ddca33f 100644
--- a/src/OpenFOAM/db/error/error.C
+++ b/src/OpenFOAM/db/error/error.C
@@ -31,7 +31,8 @@ License
 #include "Pstream.H"
 #include "OSspecific.H"
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::error::error(const string& title)
 :
@@ -88,12 +89,16 @@ Foam::error::error(const error& err)
 }
 
 
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
 Foam::error::~error() throw()
 {
     delete messageStreamPtr_;
 }
 
 
+// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
+
 Foam::OSstream& Foam::error::operator()
 (
     const char* functionName,
@@ -156,6 +161,8 @@ Foam::error::operator Foam::dictionary() const
 }
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
 Foam::string Foam::error::message() const
 {
     return messageStreamPtr_->str();
@@ -249,18 +256,20 @@ void Foam::error::abort()
 }
 
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
+
+Foam::Ostream& Foam::operator<<(Ostream& os, const error& err)
 {
-    os  << endl
-        << fErr.title().c_str() << endl
-        << fErr.message().c_str();
+    os  << nl
+        << err.title().c_str() << endl
+        << err.message().c_str();
 
-    if (error::level >= 2 && fErr.sourceFileLineNumber())
+    if (error::level >= 2 && err.sourceFileLineNumber())
     {
-        os  << endl << endl
-            << "    From function " << fErr.functionName().c_str() << endl
-            << "    in file " << fErr.sourceFileName().c_str()
-            << " at line " << fErr.sourceFileLineNumber() << '.';
+        os  << nl << nl
+            << "    From function " << err.functionName().c_str() << endl
+            << "    in file " << err.sourceFileName().c_str()
+            << " at line " << err.sourceFileLineNumber() << '.';
     }
 
     return os;
@@ -272,4 +281,5 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
 
 Foam::error Foam::FatalError("--> FOAM FATAL ERROR: ");
 
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/error/error.H b/src/OpenFOAM/db/error/error.H
index df42bf1ce0c8180e2deea96aa8a34528d100b02d..961bd3cd4dc9ea41eb4765520dd92e776e24c0e3 100644
--- a/src/OpenFOAM/db/error/error.H
+++ b/src/OpenFOAM/db/error/error.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2015 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2015-2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -30,7 +30,7 @@ Description
 
     The error class is globally instantiated with a title string. Errors,
     messages and other data are piped to the messageStream class in the
-    standard manner.  Manipulators are supplied for exit and abort which may
+    standard manner.  Manipulators are supplied for exit and abort that may
     terminate the program or throw an exception depending on whether the
     exception handling has been switched on (off by default).
 
@@ -57,7 +57,7 @@ namespace Foam
 
 // Forward declaration of friend functions and operators
 class error;
-Ostream& operator<<(Ostream&, const error&);
+Ostream& operator<<(Ostream& os, const error& err);
 
 
 /*---------------------------------------------------------------------------*\
@@ -90,10 +90,10 @@ public:
         error(const string& title);
 
         //- Construct from dictionary
-        error(const dictionary&);
+        error(const dictionary& errDict);
 
         //- Construct as copy
-        error(const error&);
+        error(const error& err);
 
 
     //- Destructor
@@ -104,29 +104,48 @@ public:
 
         string message() const;
 
-        const string& functionName() const
+        inline const string& functionName() const
         {
             return functionName_;
         }
 
-        const string& sourceFileName() const
+        inline const string& sourceFileName() const
         {
             return sourceFileName_;
         }
 
-        label sourceFileLineNumber() const
+        inline label sourceFileLineNumber() const
         {
             return sourceFileLineNumber_;
         }
 
-        void throwExceptions()
+        //- Return the current exception throwing (on or off)
+        inline bool throwing() const
         {
-            throwExceptions_ = true;
+            return throwExceptions_;
         }
 
-        void dontThrowExceptions()
+        //- Activate/deactivate exception throwing
+        //  \return the previous throwing state
+        inline bool throwExceptions(bool doThrow)
         {
-            throwExceptions_ = false;
+            const bool prev = throwExceptions_;
+            throwExceptions_ = doThrow;
+            return prev;
+        }
+
+        //- Activate exception throwing
+        //  \return the previous throwing state
+        inline bool throwExceptions()
+        {
+            return throwExceptions(true);
+        }
+
+        //- Deactivate exception throwing
+        //  \return the previous throwing state
+        inline bool dontThrowExceptions()
+        {
+            return throwExceptions(false);
         }
 
         //- Convert to OSstream
@@ -157,16 +176,16 @@ public:
             return operator OSstream&();
         }
 
-        //- Create and return a dictionary
+        //- Create and return a dictionary representation of the error
         operator dictionary() const;
 
 
         //- Helper function to print a stack (if OpenFOAM IO not yet
         //  initialised)
-        static void safePrintStack(std::ostream&);
+        static void safePrintStack(std::ostream& os);
 
         //- Helper function to print a stack
-        static void printStack(Ostream&);
+        static void printStack(Ostream& os);
 
         //- Exit : can be called for any error to exit program.
         //  Prints stack before exiting.
@@ -179,13 +198,13 @@ public:
 
     // Ostream operator
 
-        friend Ostream& operator<<(Ostream&, const error&);
+        friend Ostream& operator<<(Ostream& os, const error& err);
 };
 
 
 // Forward declaration of friend functions and operators
 class IOerror;
-Ostream& operator<<(Ostream&, const IOerror&);
+Ostream& operator<<(Ostream& os, const IOerror& err);
 
 
 /*---------------------------------------------------------------------------*\
@@ -212,7 +231,7 @@ public:
         IOerror(const string& title);
 
         //- Construct from dictionary
-        IOerror(const dictionary&);
+        IOerror(const dictionary& errDict);
 
 
     //- Destructor
@@ -221,17 +240,17 @@ public:
 
     // Member functions
 
-        const string& ioFileName() const
+        inline const string& ioFileName() const
         {
             return ioFileName_;
         }
 
-        label ioStartLineNumber() const
+        inline label ioStartLineNumber() const
         {
             return ioStartLineNumber_;
         }
 
-        label ioEndLineNumber() const
+        inline label ioEndLineNumber() const
         {
             return ioEndLineNumber_;
         }
@@ -279,7 +298,7 @@ public:
             const string& msg
         );
 
-        //- Create and return a dictionary
+        //- Create and return a dictionary representation of the error
         operator dictionary() const;
 
 
@@ -292,7 +311,7 @@ public:
 
     // Ostream operator
 
-        friend Ostream& operator<<(Ostream&, const IOerror&);
+        friend Ostream& operator<<(Ostream& os, const IOerror& err);
 };
 
 
diff --git a/src/OpenFOAM/db/error/messageStream.C b/src/OpenFOAM/db/error/messageStream.C
index 661d24960247b1961f0dd0ce93c8cc043392cec2..c0b9e7219bce2a760e3b30f2a76102b29b5504bc 100644
--- a/src/OpenFOAM/db/error/messageStream.C
+++ b/src/OpenFOAM/db/error/messageStream.C
@@ -90,8 +90,8 @@ Foam::OSstream& Foam::messageStream::operator()
 {
     OSstream& os = operator OSstream&();
 
-    os  << endl
-        << "    From function " << functionName << endl
+    os  << nl
+        << "    From function " << functionName << nl
         << "    in file " << sourceFileName
         << " at line " << sourceFileLineNumber << endl
         << "    ";
@@ -194,7 +194,7 @@ Foam::messageStream::operator Foam::OSstream&()
 {
     if (level)
     {
-        bool collect = (severity_ == INFO || severity_ == WARNING);
+        const bool collect = (severity_ == INFO || severity_ == WARNING);
 
         // Report the error
         if (!Pstream::master() && collect)
diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
index 37db0a306711a7a0d1d28202aa85d8923b9660da..9f6070472a3156813fbdc7e108563dd27e8307a5 100644
--- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
+++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
@@ -752,8 +752,10 @@ bool Foam::functionObjectList::read()
             {
                 autoPtr<functionObject> foPtr;
 
-                FatalError.throwExceptions();
-                FatalIOError.throwExceptions();
+                // Throw FatalError, FatalIOError as exceptions
+                const bool throwingError = FatalError.throwExceptions();
+                const bool throwingIOerr = FatalIOError.throwExceptions();
+
                 try
                 {
                     // New functionObject
@@ -784,8 +786,10 @@ bool Foam::functionObjectList::read()
                     WarningInFunction
                         << "Caught FatalError " << err << nl << endl;
                 }
-                FatalError.dontThrowExceptions();
-                FatalIOError.dontThrowExceptions();
+
+                // Restore previous exception throwing state
+                FatalError.throwExceptions(throwingError);
+                FatalIOError.throwExceptions(throwingIOerr);
 
                 if (foPtr.valid())
                 {