Is there a way to use try() with undeclared module outputs?

I am attempting to implement a terrafform module that can use output values from other modules that may or may not be part of the overall terrafform configuration (we use a variety of configurations for different CI purposes).

I have attempted to leverage the try() function to handle the error produced from referencing an undeclared module, but try() doesn’t appear to be capable of handling this use case as I still get “module not declared” errors.

Is there a specific way to use try() that will allow me to catch this error? Alternatively, is there a better function or approach to use for this case? Any help is greatly appreciated!