Skip to content

Commit

Permalink
Add more verbose logging if "CheckForMissingResources" fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Shulman committed Aug 22, 2024
1 parent b007485 commit b3b08a1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pwiz_tools/Skyline/TestData/ResourcesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Resources;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -28,6 +29,7 @@
using pwiz.ProteomeDatabase.API;
using pwiz.ProteowizardWrapper;
using pwiz.Skyline;
using pwiz.Skyline.Util.Extensions;
using pwiz.SkylineTestUtil;

namespace pwiz.SkylineTestData
Expand Down Expand Up @@ -57,7 +59,18 @@ public void CheckForMissingResources()
typeof(BiblioSpec.BlibBuild).Assembly // BiblioSpec
})
{
foreach (var type in assembly.GetTypes())
Type[] assemblyTypes;
try
{
assemblyTypes = assembly.GetTypes();
}
catch (ReflectionTypeLoadException reflectionTypeLoadException)
{
// Write out the "LoaderExceptions" property because it is not included in this exception's ToString()
Console.Out.WriteLine("Exception getting types for assembly {0}:\r\n{1}\r\nLoaderExceptions property:{2}", assembly.FullName, reflectionTypeLoadException, TextUtil.LineSeparate(reflectionTypeLoadException.LoaderExceptions?.Select(e=>e.ToString())) ?? "null");
throw;
}
foreach (var type in assemblyTypes)
{
if (!IsResourceType(type))
{
Expand Down

0 comments on commit b3b08a1

Please sign in to comment.