x) Catch more generic IO issues

x) Add a default filename of <unknown> for default created resources
This commit is contained in:
Marc Hernandez 2021-01-02 13:18:05 -08:00 committed by Marc Hernandez
parent 7560e6bf56
commit 065ec3b237
2 changed files with 7 additions and 5 deletions

View File

@ -91,7 +91,7 @@ namespace lib
cfg.SetFilename( filename );
}
catch( FileNotFoundException )
catch( IOException )
{
Type[] types = new Type[0];
object[] parms = new object[0];

View File

@ -53,10 +53,12 @@ namespace res
[Serializable]
public class Ref<T>: Ref where T : class
{
public T res => m_res != null ? m_res : m_res = Mgr.load<T>( filename );
//For serialization
public Ref()
public T res => m_res != null ? m_res : m_res = Mgr.load<T>( filename );
//For serialization
public Ref()
:
base( "<unknown>" )
{
}