diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-13 20:41:00 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-13 20:41:00 -0400 |
commit | 7f368aa8896baa551aa156a8e67e9dd16416022d (patch) | |
tree | c741e209e0161e3234d86559febce0e83d2e5a42 /src/StardewModdingAPI/Program.cs | |
parent | 9b6c0d1021b07ec04b589f1bd0eb69e36082b600 (diff) | |
download | SMAPI-7f368aa8896baa551aa156a8e67e9dd16416022d.tar.gz SMAPI-7f368aa8896baa551aa156a8e67e9dd16416022d.tar.bz2 SMAPI-7f368aa8896baa551aa156a8e67e9dd16416022d.zip |
enforce metadata.SetStatus() instead of setting properties directly (#285)
Diffstat (limited to 'src/StardewModdingAPI/Program.cs')
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index 74a9ff8e..37e1e000 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -337,15 +337,11 @@ namespace StardewModdingAPI string psDir = Path.Combine(mod.DirectoryPath, "psconfigs"); Directory.CreateDirectory(psDir); if (!Directory.Exists(psDir)) - { - mod.Status = ModMetadataStatus.Failed; - mod.Error = "it requires per-save configuration files ('psconfigs') which couldn't be created for some reason."; - } + mod.SetStatus(ModMetadataStatus.Failed, "it requires per-save configuration files ('psconfigs') which couldn't be created for some reason."); } catch (Exception ex) { - mod.Status = ModMetadataStatus.Failed; - mod.Error = $"it requires per-save configuration files ('psconfigs') which couldn't be created: {ex.GetLogSummary()}"; + mod.SetStatus(ModMetadataStatus.Failed, $"it requires per-save configuration files ('psconfigs') which couldn't be created: {ex.GetLogSummary()}"); } } } |