Skip to content

Commit

Permalink
rename error to exception, throw on release
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed Jun 15, 2023
1 parent 5e228af commit 7b82569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions flixel/system/debug/log/LogStyle.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ class LogStyle
public var callbackFunction:()->Void;

/**
* Whether an error is thrown when this LogStyle is used
* Whether an exception is thrown when this LogStyle is used.
* **Note**: Unlike other log style properties, this happens even in release mode.
* @since 5.4.0
*/
public var throwError:Bool = false;
public var throwException:Bool = false;

/**
* Create a new LogStyle to be used in conjunction with `FlxG.log.advanced()`
Expand All @@ -61,7 +62,7 @@ class LogStyle
* @param throwError Whether an error is thrown when this LogStyle is used
*/
public function new(prefix = "", color = "FFFFFF", size = 12, bold = false, italic = false, underlined = false,
?errorSound:String, openConsole = false, ?callback:()->Void, throwError = false)
?errorSound:String, openConsole = false, ?callback:()->Void, throwException = false)
{
this.prefix = prefix;
this.color = color;
Expand All @@ -72,7 +73,7 @@ class LogStyle
this.errorSound = errorSound;
this.openConsole = openConsole;
this.callbackFunction = callback;
this.throwError = throwError;
this.throwException = throwException;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion flixel/system/frontEnds/LogFrontEnd.hx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class LogFrontEnd
}
#end

if (style.throwError)
if (style.throwException)
throw style.toLogString(data);
}

Expand Down

0 comments on commit 7b82569

Please sign in to comment.