I'm making some changes to our fork of GetPot at the moment, most of
which are backwards compatible, but one of which might not be:

I just noticed that when you try to get a GetPot object to parse a
non-existent file, it doesn't give any kind of warning or error, it
just does absolutely nothing and returns.

This is definitely a deliberate design decision by the original GetPot
author, but I don't think it's the design we want.  Other options:

1. Return with no changed options, so we're completely backwards
compatible, but first set a flag such that a new "GetPot::good()"
method would start returning false instead of true, and paranoid user
codes could test this method.  This is still an improvement over
letting paranoid user codes try opening the file themselves first,
which would have a race condition in some circumstances and which
wouldn't work well with the "include directives" I'm adding now.

2. getpot_error() if the file can't be opened - for us this is a
libmesh_error() with the usual screaming and exception throwing.

3. Throw a different exception, a libMesh::FileError or something else
that can be more easily distinguished from a logic error by catch().

I'm leaning towards 2 but I'll change my mind if other libMesh users
prefer 1 or 3.
---
Roy

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to