1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 20:07:29 +08:00

Log the format line when a decoder isn't found

This commit is contained in:
smoogipoo 2018-08-24 10:03:56 +09:00
parent dc8bcb2a18
commit 407968bb7e

View File

@ -55,11 +55,11 @@ namespace osu.Game.Beatmaps.Formats
} while (line != null && line.Length == 0); } while (line != null && line.Length == 0);
if (line == null) if (line == null)
throw new IOException(@"Unknown file format"); throw new IOException(@"Unknown file format (null)");
var decoder = typedDecoders.Select(d => line.StartsWith(d.Key) ? d.Value : null).FirstOrDefault(); var decoder = typedDecoders.Select(d => line.StartsWith(d.Key) ? d.Value : null).FirstOrDefault();
if (decoder == null) if (decoder == null)
throw new IOException(@"Unknown file format"); throw new IOException($@"Unknown file format ({line})");
return (Decoder<T>)decoder.Invoke(line); return (Decoder<T>)decoder.Invoke(line);
} }