Skip to content

Commit 5edf551

Browse files
authored
Add comment about the error handling way
Handle exceptions during type attribute loading and return false to prevent further error reporting.
1 parent ab2fc51 commit 5edf551

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Reqnroll/Bindings/Discovery/RuntimeBindingRegistryBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ internal bool BuildBindingsFromType(Type type)
8383
catch (Exception ex)
8484
{
8585
_bindingSourceProcessor.RegisterTypeLoadError($"Could not load attributes for type '{type.FullName}': {ex}");
86+
// When the type attributes cannot be loaded, the type cannot be processed anyway so we can return with false here to avoid reporting further errors.
8687
return false;
8788
}
8889
var filteredAttributes = reflectedAttributes.Where(attr => _bindingSourceProcessor.CanProcessTypeAttribute(attr.GetType().FullName));

0 commit comments

Comments
 (0)