Fixing script crash message

No more LIB_modname.hx in the logs
This commit is contained in:
NeeEoo
2024-02-11 20:46:08 +01:00
parent 7e1db2f4c6
commit e6ff26fd2e
3 changed files with 26 additions and 3 deletions
+4 -3
View File
@@ -11,7 +11,7 @@ class HScript extends Script {
public var parser:Parser;
public var expr:Expr;
public var code:String = null;
public var folderlessPath:String;
//public var folderlessPath:String;
var __importedPaths:Array<String>;
public static function initParser() {
@@ -27,11 +27,11 @@ class HScript extends Script {
interp = new Interp();
try {
if(Assets.exists(path)) code = Assets.getText(path);
if(Assets.exists(rawPath)) code = Assets.getText(rawPath);
} catch(e) Logs.trace('Error while reading $path: ${Std.string(e)}', ERROR);
parser = initParser();
folderlessPath = Path.directory(path);
//folderlessPath = Path.directory(path);
__importedPaths = [path];
interp.errorHandler = _errorHandler;
@@ -92,6 +92,7 @@ class HScript extends Script {
private function _errorHandler(error:Error) {
// This should be ${error.file} later
var fn = '$fileName:${error.line}: ';
var err = error.toString();
if (err.startsWith(fn)) err = err.substr(fn.length);