mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-25 22:18:34 +01:00
Rethrow exceptions when no RawContentManager readers could be constructed
This commit is contained in:
parent
29bbd61f8b
commit
b2b34abcd0
2 changed files with 9 additions and 2 deletions
|
@ -21,6 +21,10 @@ Improvements
|
|||
Improvements
|
||||
- Allow for checkboxes and radio buttons to be disabled
|
||||
|
||||
### MLEM.Data
|
||||
Improvements
|
||||
- Rethrow exceptions when no RawContentManager readers could be constructed
|
||||
|
||||
## 5.2.0
|
||||
### MLEM
|
||||
Additions
|
||||
|
|
|
@ -99,6 +99,7 @@ namespace MLEM.Data.Content {
|
|||
|
||||
private static List<RawContentReader> CollectContentReaders() {
|
||||
var ret = new List<RawContentReader>();
|
||||
var assemblyExceptions = new List<Exception>();
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
|
||||
try {
|
||||
if (assembly.IsDynamic)
|
||||
|
@ -114,10 +115,12 @@ namespace MLEM.Data.Content {
|
|||
throw new NotSupportedException($"The type {type} cannot be constructed by a RawContentManager. Does it have a visible parameterless constructor?", e);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// ignored
|
||||
} catch (Exception e) {
|
||||
assemblyExceptions.Add(e);
|
||||
}
|
||||
}
|
||||
if (ret.Count <= 0)
|
||||
throw new AggregateException("Failed to construct any RawContentReader instances", assemblyExceptions);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue