Is there any way to suppress error reporting for "Unable to locate..."

I often define the name in Set Global Property using a BeanShell expression such as {LocationName+"_Control"} - but the risk with an expression like that is you’ll get nasty “Unable to locate Global Property…” errors unless you define a Global Property for every conceivable map location, perhaps even hundreds that you don’t actually need. My workaround has always been to gate that Set Global Property with either a Trigger Action or Restrict Command that filters out the unused locations. It’s a lot of work though and occasionally a bug isn’t discovered until many months later. Is there any way to suppress error reporting whenever Vassal is unable to locate a Dynamic or Global Property?

If you set up a GP in the root folder of the module, then that GP is available for any map. At least that is my understanding.
You can set up GPs for use within a particular map, but they can only be used for that map.
Happy to be corrected.

I’m referring to using Beanshell expressions to concatenate a Property name that may or may not exist. Because it’s a formula, depending on the variables used, there could many many permutations and combinations. The brute force solution is to define every possible Property name, even those that you never intend to use. The cleaner solution is to carefully construct Trigger Actions and Restrict Commands to prevent the SGP from generating an undefined result. Both are very time consuming just to prevent a non-fatal error report in the chat window.

Instead of using location name, which I assume may or may not be defined within your module, have you considered using perhaps CurrentMap (even CurrentBoard) with, perhaps CurrentX/CurrentY?
Just a thought.

The LocationName is a specific use case, but I’m seeking a general solution. CurrentMap or xy coordinates wouldn’t work tho. I’m trying to lookup GPs based on a unit’s location. For instance, if a unit is in Bucharest, I want to query how much oil is in Bucharest. It is defined by Bucharest_Oil. But if the unit is in Eastern Mediterranean, I don’t want to create a dummy GP called Eastern Mediterranean_Oil simply to prevent a non-fatal error being reported by Vassal. If only 10 of 500 locations can have oil, it’s alot of unnecessary tedium to define 490 GPs simply to prevent error messages…

Re think your philosophy, it has very serious flaws. Asking the developers to modify Vassal to try and resolve your, singular, issue is not the way forward.
Can I assume you are using the inventory function? If not why not?
Tag every oil piece with something like:

  1. I am an oil unit (marker trait - oilstore==“yes”).
  2. My current value of oil stored is ‘x’ (text trait ‘oilstored’ with players being able to change that quantity).
  3. Inventory facility of Vassal ‘find oil storage units and report qty’. Yes I appreciate that is not what you would use, but it is an indication.
    With my modules I have inventory finds to pinpoint headquarters, oil usage counters and (where the F are my) naval transports. For each major power.
    Feel free to download and have a gander. World in Flames. Links to the modules are in the Vassal modules area. Not the one at the top, but any of the 3 following that one.

Oil is a quanity that is counted by a GP. It is not a unit or piece so the inventory function is not applicable. I’ve been programming professionally for over 30 years. My philosophy is sound. No need for ad hominem attacks. It was simply a nice-to-have-request as I already have a fully functional module with extensive automation. I stated the workaround I’ve been using in my OP.

OK, fine, very touchy aren’t we. Am I really overtly attacking you? I think not.
Obviously I fail to comprehend what you have and what you are trying to do. If oil is a qty counted by a GP then that GP really does not care where that oil is stored. The GP just ‘says’ you have this much oil. The GP does not give a gnats whisker where the oil is stored, just a total number.
You bona-fides may indeed be impeccable, but you are not programming with Vassal. You are using it (unless you are using your own custom java coding).
I remain with my previous missive that what you want is flawed from the get go.
Perhaps if I can have a peek at your module! Enlightenment increases exponentially with knowledge. This module is available via the Vassal modules area?

PS I would like to help out, but more data is required.