only assume insufficient funds in paid action if the error says so
This commit is contained in:
		
							parent
							
								
									2dd96f4b83
								
							
						
					
					
						commit
						1a3785a865
					
				@ -58,8 +58,8 @@ export default async function performPaidAction (actionType, args, context) {
 | 
				
			|||||||
      } catch (e) {
 | 
					      } catch (e) {
 | 
				
			||||||
        console.error('fee credit action failed', e)
 | 
					        console.error('fee credit action failed', e)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // if we fail to do the action with fee credits, but the cost is 0, we should bail
 | 
					        // if we fail with fee credits, but not because of insufficient funds, bail
 | 
				
			||||||
        if (context.cost === 0n) {
 | 
					        if (!e.message.includes('\\"users\\" violates check constraint \\"msats_positive\\"')) {
 | 
				
			||||||
          throw e
 | 
					          throw e
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user