mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +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
|
Improvements
|
||||||
- Allow for checkboxes and radio buttons to be disabled
|
- Allow for checkboxes and radio buttons to be disabled
|
||||||
|
|
||||||
|
### MLEM.Data
|
||||||
|
Improvements
|
||||||
|
- Rethrow exceptions when no RawContentManager readers could be constructed
|
||||||
|
|
||||||
## 5.2.0
|
## 5.2.0
|
||||||
### MLEM
|
### MLEM
|
||||||
Additions
|
Additions
|
||||||
|
|
|
@ -99,6 +99,7 @@ namespace MLEM.Data.Content {
|
||||||
|
|
||||||
private static List<RawContentReader> CollectContentReaders() {
|
private static List<RawContentReader> CollectContentReaders() {
|
||||||
var ret = new List<RawContentReader>();
|
var ret = new List<RawContentReader>();
|
||||||
|
var assemblyExceptions = new List<Exception>();
|
||||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
|
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
|
||||||
try {
|
try {
|
||||||
if (assembly.IsDynamic)
|
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);
|
throw new NotSupportedException($"The type {type} cannot be constructed by a RawContentManager. Does it have a visible parameterless constructor?", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (Exception e) {
|
||||||
// ignored
|
assemblyExceptions.Add(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ret.Count <= 0)
|
||||||
|
throw new AggregateException("Failed to construct any RawContentReader instances", assemblyExceptions);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue