mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-23 22:00:10 +08:00
Add ExceptionCollector.throwLast
This commit is contained in:
parent
c9a3bb23ee
commit
a62c570205
@ -64,6 +64,11 @@ public class ExceptionCollector : Sequence<Throwable> {
|
||||
throw getLast()!!
|
||||
}
|
||||
|
||||
@TerminalOperation
|
||||
public fun throwLast(): Nothing {
|
||||
throw getLast() ?: error("Internal error: expected at least one exception collected.")
|
||||
}
|
||||
|
||||
@DslMarker
|
||||
private annotation class TerminalOperation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user