Skip to content

Commit

Permalink
[PixImage] List available loaders in exception on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
hyazinthh committed May 22, 2024
1 parent 0c63081 commit 6082627
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Aardvark.Base.Tensors.CSharp/PixImage/PixImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,20 @@ internal static Result InvokeLoaders<Input, Result>(
var result = tryInvoke(loaders[i], input);
if (isValid(result)) return result;
}

if (loaders.Count == 0)
{
errorMessage += " - No loaders available!";
}
else
{
errorMessage += " - Available loaders:" + Environment.NewLine;

foreach (var l in loaders)
{
errorMessage += " - " + l.Name + Environment.NewLine;
}
}
}

throw new ImageLoadException(errorMessage);
Expand Down

0 comments on commit 6082627

Please sign in to comment.