Skip to content

Commit b11e995

Browse files
authored
fix: added missing textureError error object (#749)
2 parents 358a596 + 0dc6edb commit b11e995

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/core/CoreTextureManager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ export class CoreTextureManager extends EventEmitter {
260260
let texture: Texture | undefined;
261261
const TextureClass = this.txConstructors[textureType];
262262
if (!TextureClass) {
263-
throw new Error(`Texture type "${textureType}" is not registered`);
263+
throw new TextureError(
264+
TextureErrorCode.TEXTURE_TYPE_NOT_REGISTERED,
265+
`Texture type "${textureType}" is not registered`,
266+
);
264267
}
265268
const resolvedProps = TextureClass.resolveDefaults(props as any);
266269
const cacheKey = TextureClass.makeCacheKey(resolvedProps as any);
@@ -339,7 +342,10 @@ export class CoreTextureManager extends EventEmitter {
339342
this.stage.txMemManager.criticalCleanupRequested === true
340343
) {
341344
// we're at a critical memory threshold, don't upload textures
342-
texture.setState('failed');
345+
texture.setState(
346+
'failed',
347+
new TextureError(TextureErrorCode.MEMORY_THRESHOLD_EXCEEDED),
348+
);
343349
return;
344350
}
345351

0 commit comments

Comments
 (0)