Fixed importing error messages being hidden, closes #128

This commit is contained in:
Lucas Dower 2023-06-01 20:32:31 +01:00
parent 50a68b5190
commit 21ea0e7c2c

View File

@ -176,10 +176,9 @@ export class ObjImporter extends IImporter {
];
public override import(file: File): Promise<Mesh> {
return new Promise((res, rej) => {
file.text().then((fileSource) => {
return file.text().then((fileSource) => {
if (fileSource.includes('<27>')) {
rej(new AppError(LOC('import.invalid_encoding')));
throw new AppError(LOC('import.invalid_encoding'));
}
fileSource.replace('\r', ''); // Convert Windows carriage return
@ -189,8 +188,7 @@ export class ObjImporter extends IImporter {
this.parseOBJLine(line);
}
res(new Mesh(this._vertices, this._normals, this._uvs, this._tris, new Map()));
});
return new Mesh(this._vertices, this._normals, this._uvs, this._tris, new Map());
});
}
public parseOBJLine(line: string) {