Cleaned up Warning And Error Code

This commit is contained in:
NeeEoo
2024-04-10 16:37:19 +02:00
parent a8f35ad81c
commit d955e00ece
33 changed files with 106 additions and 93 deletions
+5 -5
View File
@@ -75,7 +75,7 @@ class OptionsMenu extends TreeMenu {
try {
access = new Access(Xml.parse(Paths.assetsTree.getSpecificAsset(xmlPath, "TEXT", source)));
} catch(e) {
Logs.trace('Error while parsing options.xml: ${Std.string(e)}', ERROR);
Logs.error('Error while parsing options.xml: ${Std.string(e)}');
}
if (access != null)
@@ -100,7 +100,7 @@ class OptionsMenu extends TreeMenu {
for(node in xml.elements) {
if (!node.has.name) {
Logs.trace("An option node requires a name attribute.", WARNING);
Logs.warn("An option node requires a name attribute.");
continue;
}
var name = node.getAtt("name");
@@ -109,20 +109,20 @@ class OptionsMenu extends TreeMenu {
switch(node.name) {
case "checkbox":
if (!node.has.id) {
Logs.trace("A checkbox option requires an \"id\" for option saving.", WARNING);
Logs.warn("A checkbox option requires an \"id\" for option saving.");
continue;
}
options.push(new Checkbox(name, desc, node.att.id, FlxG.save.data));
case "number":
if (!node.has.id) {
Logs.trace("A number option requires an \"id\" for option saving.", WARNING);
Logs.warn("A number option requires an \"id\" for option saving.");
continue;
}
options.push(new NumOption(name, desc, Std.parseFloat(node.att.min), Std.parseFloat(node.att.max), Std.parseFloat(node.att.change), node.att.id, null, FlxG.save.data));
case "choice":
if (!node.has.id) {
Logs.trace("A choice option requires an \"id\" for option saving.", WARNING);
Logs.warn("A choice option requires an \"id\" for option saving.");
continue;
}
@@ -64,7 +64,7 @@ class GithubUserIcon extends FlxSprite
var bytes = null;
if(unfLink) {
try bytes = HttpUtil.requestBytes('${user.avatar_url}?size=$size')
catch(e) Logs.traceColored([Logs.logText('Failed to download github pfp for ${user.login}: ${CoolUtil.removeIP(e.message)} - (Retrying using the api..)', RED)], ERROR);
catch(e) Logs.error('Failed to download github pfp for ${user.login}: ${CoolUtil.removeIP(e.message)} - (Retrying using the api..)');
if(bytes != null) {
bmap = BitmapData.fromBytes(bytes);
@@ -73,9 +73,9 @@ class GithubUserIcon extends FlxSprite
}
if(planB) {
if(unfLink) user = GitHub.getUser(user.login, function(e) Logs.traceColored([Logs.logText('Failed to download github user info for ${user.login}: ${CoolUtil.removeIP(e.message)}', RED)], ERROR)); // Api part - Nex
if(unfLink) user = GitHub.getUser(user.login, function(e) Logs.error('Failed to download github user info for ${user.login}: ${CoolUtil.removeIP(e.message)}')); // Api part - Nex
try bytes = HttpUtil.requestBytes('${user.avatar_url}&size=$size')
catch(e) Logs.traceColored([Logs.logText('Failed to download github pfp for ${user.login}: ${CoolUtil.removeIP(e.message)}', RED)], ERROR);
catch(e) Logs.error('Failed to download github pfp for ${user.login}: ${CoolUtil.removeIP(e.message)}');
if(bytes != null) bmap = BitmapData.fromBytes(bytes);
}
@@ -88,7 +88,7 @@ class GithubUserIcon extends FlxSprite
bmap = null;
mutex.release();
} catch(e) {
Logs.traceColored([Logs.logText('Failed to update the pfp for ${user.login}: ${e.message}', RED)], ERROR);
Logs.error('Failed to update the pfp for ${user.login}: ${e.message}');
}
} else {
mutex.acquire();