forked from cadence/out-of-your-element
		
	Don't explode if it can't send follow-up errors
This _should_ be awaited all the way up, but it didn't work for me, and better safe than sorry I guess?
This commit is contained in:
		
							parent
							
								
									160efc5592
								
							
						
					
					
						commit
						2a0e22a122
					
				
					 1 changed files with 12 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -128,16 +128,18 @@ async function sendError(roomID, source, type, e, payload) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	// Send
 | 
			
		||||
	await api.sendEvent(roomID, "m.room.message", {
 | 
			
		||||
		...builder.get(),
 | 
			
		||||
		"moe.cadence.ooye.error": {
 | 
			
		||||
			source: source.toLowerCase(),
 | 
			
		||||
			payload
 | 
			
		||||
		},
 | 
			
		||||
		"m.mentions": {
 | 
			
		||||
			user_ids: ["@cadence:cadence.moe"]
 | 
			
		||||
		}
 | 
			
		||||
	})
 | 
			
		||||
	try {
 | 
			
		||||
		await api.sendEvent(roomID, "m.room.message", {
 | 
			
		||||
			...builder.get(),
 | 
			
		||||
			"moe.cadence.ooye.error": {
 | 
			
		||||
				source: source.toLowerCase(),
 | 
			
		||||
				payload
 | 
			
		||||
			},
 | 
			
		||||
			"m.mentions": {
 | 
			
		||||
				user_ids: ["@cadence:cadence.moe"]
 | 
			
		||||
			}
 | 
			
		||||
		})
 | 
			
		||||
	} catch (e) {}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function guard(type, fn) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue