1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Display error for theme file failure

This commit is contained in:
Brian Fiete 2023-06-23 07:15:38 -04:00
parent 269716c0d4
commit 19a2855da9
2 changed files with 9 additions and 4 deletions

View file

@ -21,11 +21,12 @@ namespace Beefy.utils
case UnexpectedObjectEnd;
case ExpectedArrayNameEnd;
/*public override void ToString(String str)
public override void ToString(String str)
{
switch (this)
{
case FormatError: str.Append("Format error");
case FileError: str.Append("File error");
case FormatError(let line): str.AppendF($"Format error on line {line}");
case ParseError: str.Append("Parse error");
case ColonNotExpected: str.Append("Colon not expected");
case KeyInArray: str.Append("Cannot add key/val to array");
@ -33,8 +34,9 @@ namespace Beefy.utils
case ValueExpected: str.Append("Value expected");
case PrecedingCommaExpected: str.Append("Preceding comma expected");
case UnexpectedObjectEnd: str.Append("Unexpected object end");
case ExpectedArrayNameEnd: str.Append("Expected array name end");
}
}*/
}
}
public struct Enumerator : IEnumerator<StringView>

View file

@ -478,8 +478,11 @@ namespace IDE
return;
StructuredData sd = scope .();
if (sd.Load(themeFilePath) case .Err)
if (sd.Load(themeFilePath) case .Err(var err))
{
gApp.OutputErrorLine($"Failed to load theme file '{themeFilePath}': {err}");
return;
}
using (sd.Open("Colors"))
mColors.Deserialize(sd);