@@ -326,23 +326,24 @@ function Base.showerror(io::IO, err::UnexpectedSymbolicValueInVarmap)
326326end 
327327
328328struct  MissingGuessError <:  Exception 
329-     sym :: Any 
330-     val :: Any 
329+     syms :: Vector{ Any} 
330+     vals :: Vector{ Any} 
331331end 
332332
333333function  Base. showerror (io:: IO , err:: MissingGuessError ) 
334334    println (io, 
335335            """ 
336336            Unable to resolve numeric guesses for all of the variables in the system. \ 
337-             This may be because your guesses are cyclic. 
337+             This may be because your guesses are cyclic. In order for the problem to be \ 
338+             initialized, all of the variables must have a numeric value to serve as a \ 
339+             starting point for the nonlinear solve.  
338340
339-             In order for the problem to be initialized, all of the variables must have \ 
340-             a numeric value to serve as a starting point for the nonlinear solve. \ 
341-             Please provide an additional numeric guess to `guesses` in \ 
342-             the problem constructor. 
343- 
344-             This error was thrown because symbolic value $(err. val)  was found for variable $(err. sym) . 
341+             Symbolic values were found for the following variables/parameters in the map; \ 
342+             please provide additional numeric guesses so they can resolve to numbers: 
345343            """  )
344+     for  (sym, val) in  zip (err. syms, err. vals)
345+         println (sym, "  => " 
346+     end 
346347end 
347348
348349""" 
@@ -375,13 +376,17 @@ function better_varmap_to_vars(varmap::AbstractDict, vars::Vector;
375376    end 
376377    vals =  map (x ->  varmap[x], vars)
377378    if  ! allow_symbolic
379+         missingsyms =  Any[]
380+         missingvals =  Any[]
378381        for  (sym, val) in  zip (vars, vals)
379382            symbolic_type (val) ==  NotSymbolic () &&  continue 
380-             if  is_initializeprob
381-                 throw (MissingGuessError (sym, val))
382-             else 
383-                 throw (UnexpectedSymbolicValueInVarmap (sym, val))
384-             end 
383+             push! (missingsyms, sym)
384+             push! (missingvals, val)
385+         end 
386+ 
387+         if  ! isempty (missingsyms)
388+             is_initializeprob ?  throw (MissingGuessError (missingsyms, missingvals)) :  
389+                 throw (UnexpectedSymbolicValueInVarmap (missingsyms[1 ], missingvals[1 ]))
385390        end 
386391    end 
387392
0 commit comments