receiver_worker: log processes crashes
Oban cataches crashes to handle job failure and retry, thus it never bubbles up all the way and nothing is logged by default. For better debugging, catch and log any crashes.
This commit is contained in:
		
							parent
							
								
									8fa51700d4
								
							
						
					
					
						commit
						4701aa2a38
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -50,5 +50,13 @@ def perform(%Job{args: %{"op" => "incoming_ap_doc", "params" => params}}) do
 | 
			
		|||
        Logger.error("Unexpected AP doc error: (raw) #{inspect(e)} from #{inspect(params)}")
 | 
			
		||||
        {:error, e}
 | 
			
		||||
    end
 | 
			
		||||
  rescue
 | 
			
		||||
    err ->
 | 
			
		||||
      Logger.error(
 | 
			
		||||
        "Receiver worker CRASH on #{inspect(params)} with: #{Exception.format(:error, err, __STACKTRACE__)}"
 | 
			
		||||
      )
 | 
			
		||||
 | 
			
		||||
      # reraise to let oban handle transaction conflicts without deductig an attempt
 | 
			
		||||
      reraise err, __STACKTRACE__
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue