Improve error log on resource import failure.
This commit is contained in:
@@ -157,7 +157,7 @@ namespace Cryville.Crtr.Browsing {
|
||||
resources = converter.ConvertFrom(file);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
LogAndPopup(4, ex.Message);
|
||||
LogAndPopupExtra(4, ex, "Failed to import resource: {0}", ex.Message);
|
||||
return false;
|
||||
}
|
||||
foreach (var res in resources) {
|
||||
@@ -220,6 +220,12 @@ namespace Cryville.Crtr.Browsing {
|
||||
Popup.Create(msg);
|
||||
}
|
||||
|
||||
void LogAndPopupExtra(int level, object extraLog, string format, params object[] args) {
|
||||
var msg = string.Format(format, args);
|
||||
Logger.Log("main", level, "Resource", "{0}\n{1}", msg, extraLog);
|
||||
Popup.Create(msg);
|
||||
}
|
||||
|
||||
public string[] GetSupportedFormats() {
|
||||
return converters.Keys.ToArray();
|
||||
}
|
||||
|
Reference in New Issue
Block a user