mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	improve logging a little bit
This commit is contained in:
		
							parent
							
								
									9f30d4e673
								
							
						
					
					
						commit
						8414d97ffa
					
				| @ -685,6 +685,7 @@ class Note extends Entity { | |||||||
|         delete pojo.isContentAvailable; |         delete pojo.isContentAvailable; | ||||||
|         delete pojo.__attributeCache; |         delete pojo.__attributeCache; | ||||||
|         delete pojo.titleCipherText; |         delete pojo.titleCipherText; | ||||||
|  |         delete pojo.noteContent; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -292,7 +292,7 @@ async function saveLinks(note, content) { | |||||||
| async function saveNoteRevision(note) { | async function saveNoteRevision(note) { | ||||||
|     // files and images are immutable, they can't be updated
 |     // files and images are immutable, they can't be updated
 | ||||||
|     // but we don't even version titles which is probably not correct
 |     // but we don't even version titles which is probably not correct
 | ||||||
|     if (note.type !== 'file' || note.type !== 'image' || await note.hasLabel('disableVersioning')) { |     if (note.type === 'file' || note.type === 'image' || await note.hasLabel('disableVersioning')) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -311,7 +311,7 @@ async function saveNoteRevision(note) { | |||||||
|             noteId: note.noteId, |             noteId: note.noteId, | ||||||
|             // title and text should be decrypted now
 |             // title and text should be decrypted now
 | ||||||
|             title: note.title, |             title: note.title, | ||||||
|             content: note.noteContent.content, |             content: await note.getContent(), | ||||||
|             type: note.type, |             type: note.type, | ||||||
|             mime: note.mime, |             mime: note.mime, | ||||||
|             isProtected: false, // will be fixed in the protectNoteRevisions() call
 |             isProtected: false, // will be fixed in the protectNoteRevisions() call
 | ||||||
|  | |||||||
| @ -161,7 +161,7 @@ async function transactional(func) { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     let ret = null; |     let ret = null; | ||||||
|     const error = new Error(); // to capture correct stack trace in case of exception
 |     const thisError = new Error(); // to capture correct stack trace in case of exception
 | ||||||
| 
 | 
 | ||||||
|     transactionActive = true; |     transactionActive = true; | ||||||
|     transactionPromise = new Promise(async (resolve, reject) => { |     transactionPromise = new Promise(async (resolve, reject) => { | ||||||
| @ -179,7 +179,7 @@ async function transactional(func) { | |||||||
|         } |         } | ||||||
|         catch (e) { |         catch (e) { | ||||||
|             if (transactionActive) { |             if (transactionActive) { | ||||||
|                 log.error("Error executing transaction, executing rollback. Inner exception: " + e.stack + error.stack); |                 log.error("Error executing transaction, executing rollback. Inner stack: " + e.stack + "\nOutside stack: " + thisError.stack); | ||||||
| 
 | 
 | ||||||
|                 await rollback(); |                 await rollback(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam