Fix texture importer error message by tomspilman · Pull Request #8995 · MonoGame/MonoGame

@tomspilman

When the source texture is not found we need to return an appropriate error message.

@tomspilman

@tomspilman

I was getting this error message before this fix:

2>    00:06:45.889 [E]     Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: TextureImporter failed to load 'G:/Projects/Ascent/Environment/Modular Tunnels/Long Straight/Textures/GrayGridCeilingFloor.png': no SOI
2>    00:06:45.889 [E]
2>    00:06:45.889 [E]        at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.Import(String filename, ContentImporterContext context) in D:\Projects\MonoGame\MonoGame.Framework.Content.Pipeline\TextureImporter.cs:line 84

The no SOI was coming from STB JPEG which had nothing to do with the actual error in this case.

@tomspilman

harry-cpp

if (!ContentBuilderHelper.GetImporter(relativePath, contentInfo.Importer, out IContentImporter importer))
{
Logger.Log(LogLevel.Warning, "Importer: Not found :(");
Logger.Log(LogLevel.Warning, "Importer: Not found");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(

harry-cpp