summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Program.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-05-13 20:41:00 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-05-13 20:41:00 -0400
commit7f368aa8896baa551aa156a8e67e9dd16416022d (patch)
treec741e209e0161e3234d86559febce0e83d2e5a42 /src/StardewModdingAPI/Program.cs
parent9b6c0d1021b07ec04b589f1bd0eb69e36082b600 (diff)
downloadSMAPI-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.cs8
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()}");
}
}
}