mirror of
				https://github.com/InsanusMokrassar/MicroUtils.git
				synced 2025-11-03 21:51:59 +00:00 
			
		
		
		
	safelyWithoutExceptions
This commit is contained in:
		@@ -2,6 +2,9 @@
 | 
			
		||||
 | 
			
		||||
## 0.2.5
 | 
			
		||||
 | 
			
		||||
* `Coroutines`
 | 
			
		||||
    * Function `safelyWithoutExceptions`
 | 
			
		||||
 | 
			
		||||
## 0.2.4
 | 
			
		||||
 | 
			
		||||
* `Versions`
 | 
			
		||||
 
 | 
			
		||||
@@ -21,3 +21,10 @@ suspend inline fun <T> safely(
 | 
			
		||||
        onException(e)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Shortcut for [safely] without exception handler (instead of this you will receive null as a result)
 | 
			
		||||
 */
 | 
			
		||||
suspend inline fun <T> safelyWithoutExceptions(
 | 
			
		||||
    noinline block: suspend CoroutineScope.() -> T
 | 
			
		||||
): T? = safely({ null }, block)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user