Changeset 2822


Ignore:
Timestamp:
Jul 20, 2010 1:46:14 PM (9 years ago)
Author:
jwatson
Message:

Fixing error message during model generation process. The declaration construction process was *outside* of the associated try-catch block, so the users weren't seeing any error message and didn't know where to look in their model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/base/PyomoModel.py

    r2783 r2822  
    425425                self.pprint()
    426426
    427             declaration.construct(data)
    428427            try:
    429                 pass
     428                declaration.construct(data)
    430429            except Exception, err:
    431                 msg = "%s\nError constructing declaration '%s' from data=%s"
    432                 raise err, msg % ( str(declaration.name), str(data), str(err) )
     430                msg = "Error constructing declaration '%s' from data=%s\nSource error: %s"
     431                raise RuntimeError, msg % ( str(declaration.name), str(data), str(err) )
    433432
    434433    def _load_solution(self, soln, symbol_map=None):
Note: See TracChangeset for help on using the changeset viewer.