mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
supply filename to FileNotFoundException when possible.
This commit is contained in:
parent
3034d55d47
commit
c97985e5d0
@ -300,7 +300,7 @@ namespace GameRes.Formats.Entis
|
||||
{
|
||||
var ref_info = ReadMetaData (ref_src) as EriMetaData;
|
||||
if (null == ref_info)
|
||||
throw new FileNotFoundException ("Referenced image not found");
|
||||
throw new FileNotFoundException ("Referenced image not found", ref_file);
|
||||
ref_info.FileName = ref_file;
|
||||
var ref_reader = ReadImageData (ref_src, ref_info);
|
||||
AddImageBuffer (meta, reader.Data, ref_info, ref_reader.Data);
|
||||
|
@ -109,6 +109,10 @@ namespace GameRes.Formats.KiriKiri
|
||||
if (null != blended_image)
|
||||
return blended_image;
|
||||
}
|
||||
catch (FileNotFoundException X)
|
||||
{
|
||||
Trace.WriteLine (string.Format ("{0}: {1}", X.Message, X.FileName), "[TlgFormat.Read]");
|
||||
}
|
||||
catch (Exception X)
|
||||
{
|
||||
Trace.WriteLine (X.Message, "[TlgFormat.Read]");
|
||||
|
@ -303,7 +303,7 @@ namespace GameRes
|
||||
{
|
||||
Entry entry = null;
|
||||
if (!m_dir.TryGetValue (filename, out entry))
|
||||
throw new FileNotFoundException();
|
||||
throw new FileNotFoundException ("Unable to find the specified file.", filename);
|
||||
return entry;
|
||||
}
|
||||
|
||||
@ -373,7 +373,7 @@ namespace GameRes
|
||||
var dir_name = filename + PathDelimiter;
|
||||
if (m_dir.Keys.Any (n => n.StartsWith (dir_name)))
|
||||
return new SubDirEntry (filename);
|
||||
throw new FileNotFoundException();
|
||||
throw new FileNotFoundException ("Unable to find the specified file.", filename);
|
||||
}
|
||||
|
||||
static readonly Regex path_re = new Regex (@"\G[/\\]?([^/\\]+)([/\\])");
|
||||
@ -678,7 +678,7 @@ namespace GameRes
|
||||
{
|
||||
var entry = m_vfs.Top.FindFile (desired[Count-1]);
|
||||
if (entry is SubDirEntry)
|
||||
throw new FileNotFoundException();
|
||||
throw new FileNotFoundException ("Unable to find the specified file.", desired[Count-1]);
|
||||
m_vfs.ChDir (entry);
|
||||
}
|
||||
m_vfs.Top.CurrentDirectory = desired.Last();
|
||||
|
Loading…
Reference in New Issue
Block a user