mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-15 06:44:10 +02:00
Display error for theme file failure
This commit is contained in:
parent
269716c0d4
commit
19a2855da9
2 changed files with 9 additions and 4 deletions
|
@ -21,11 +21,12 @@ namespace Beefy.utils
|
||||||
case UnexpectedObjectEnd;
|
case UnexpectedObjectEnd;
|
||||||
case ExpectedArrayNameEnd;
|
case ExpectedArrayNameEnd;
|
||||||
|
|
||||||
/*public override void ToString(String str)
|
public override void ToString(String str)
|
||||||
{
|
{
|
||||||
switch (this)
|
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 ParseError: str.Append("Parse error");
|
||||||
case ColonNotExpected: str.Append("Colon not expected");
|
case ColonNotExpected: str.Append("Colon not expected");
|
||||||
case KeyInArray: str.Append("Cannot add key/val to array");
|
case KeyInArray: str.Append("Cannot add key/val to array");
|
||||||
|
@ -33,8 +34,9 @@ namespace Beefy.utils
|
||||||
case ValueExpected: str.Append("Value expected");
|
case ValueExpected: str.Append("Value expected");
|
||||||
case PrecedingCommaExpected: str.Append("Preceding comma expected");
|
case PrecedingCommaExpected: str.Append("Preceding comma expected");
|
||||||
case UnexpectedObjectEnd: str.Append("Unexpected object end");
|
case UnexpectedObjectEnd: str.Append("Unexpected object end");
|
||||||
|
case ExpectedArrayNameEnd: str.Append("Expected array name end");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct Enumerator : IEnumerator<StringView>
|
public struct Enumerator : IEnumerator<StringView>
|
||||||
|
|
|
@ -478,8 +478,11 @@ namespace IDE
|
||||||
return;
|
return;
|
||||||
|
|
||||||
StructuredData sd = scope .();
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
using (sd.Open("Colors"))
|
using (sd.Open("Colors"))
|
||||||
mColors.Deserialize(sd);
|
mColors.Deserialize(sd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue