MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / getRecoveryStrategy

Function getRecoveryStrategy

src/utils/errorUtils.ts:68–87  ·  view source on GitHub ↗
(type: AppErrorType)

Source from the content-addressed store, hash-verified

66 * Determines the appropriate recovery strategy for an error type.
67 */
68export function getRecoveryStrategy(type: AppErrorType): RecoveryStrategy {
69 switch (type) {
70 case 'webgl_context_lost':
71 // WebGL context loss is often recoverable by waiting and retrying
72 return 'retry';
73 case 'webgl_render_error':
74 // Render errors may require a full reload
75 return 'reload';
76 case 'image_load_error':
77 // Image errors can often be retried
78 return 'retry';
79 case 'network_error':
80 // Network errors are usually temporary
81 return 'retry';
82 case 'unknown':
83 default:
84 // Unknown errors should be dismissible
85 return 'dismiss';
86 }
87}
88
89/**
90 * Checks if an error is likely a WebGL context loss event.

Callers 2

renderFallbackMethod · 0.90
isRecoverableErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected