mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	When raising an exception during exception handling, chain them together for slightly cleaner logs
This commit is contained in:
		@@ -323,11 +323,11 @@ class RasterisedDocumentParser(DocumentParser):
 | 
			
		||||
 | 
			
		||||
            except Exception as e:
 | 
			
		||||
                # If this fails, we have a serious issue at hand.
 | 
			
		||||
                raise ParseError(f"{e.__class__.__name__}: {str(e)}")
 | 
			
		||||
                raise ParseError(f"{e.__class__.__name__}: {str(e)}") from e
 | 
			
		||||
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            # Anything else is probably serious.
 | 
			
		||||
            raise ParseError(f"{e.__class__.__name__}: {str(e)}")
 | 
			
		||||
            raise ParseError(f"{e.__class__.__name__}: {str(e)}") from e
 | 
			
		||||
 | 
			
		||||
        # As a last resort, if we still don't have any text for any reason,
 | 
			
		||||
        # try to extract the text from the original document.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user