11 lines
		
	
	
	
		
			289 B
			
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			11 lines
		
	
	
	
		
			289 B
			
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| 
								 | 
							
								// Copyright 2021 Signal Messenger, LLC
							 | 
						||
| 
								 | 
							
								// SPDX-License-Identifier: AGPL-3.0-only
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export function isCorruptionError(error?: Error): boolean {
							 | 
						||
| 
								 | 
							
								  return (
							 | 
						||
| 
								 | 
							
								    error?.message?.includes('SQLITE_CORRUPT') ||
							 | 
						||
| 
								 | 
							
								    error?.message?.includes('database disk image is malformed') ||
							 | 
						||
| 
								 | 
							
								    false
							 | 
						||
| 
								 | 
							
								  );
							 | 
						||
| 
								 | 
							
								}
							 |