File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments