Rename buildErrorWithAttachment -> errorWithAttachment to emphasise the similar semantics to kotlin.error

This commit is contained in:
Ilya Kirillov
2023-06-30 15:53:54 +02:00
committed by Space Team
parent e3c31e1387
commit 2d791eb292
14 changed files with 43 additions and 43 deletions
@@ -58,7 +58,7 @@ inline fun KotlinExceptionWithAttachments.buildAttachment(
return withAttachment(name, ExceptionAttachmentBuilder().apply(buildContent).buildString())
}
inline fun buildErrorWithAttachment(
inline fun errorWithAttachment(
message: String,
cause: Exception? = null,
attachmentName: String = "info.txt",
@@ -86,7 +86,7 @@ inline fun rethrowExceptionWithDetails(
buildAttachment: ExceptionAttachmentBuilder.() -> Unit = {},
): Nothing {
if (shouldIjPlatformExceptionBeRethrown(exception)) throw exception
buildErrorWithAttachment(message, exception, attachmentName, buildAttachment)
errorWithAttachment(message, exception, attachmentName, buildAttachment)
}
@@ -99,7 +99,7 @@ inline fun checkWithAttachmentBuilder(
contract { returns() implies (condition) }
if (!condition) {
buildErrorWithAttachment(message(), buildAttachment = buildAttachment)
errorWithAttachment(message(), buildAttachment = buildAttachment)
}
}
@@ -112,6 +112,6 @@ inline fun requireWithAttachmentBuilder(
contract { returns() implies (condition) }
if (!condition) {
buildErrorWithAttachment(message(), buildAttachment = buildAttachment)
errorWithAttachment(message(), buildAttachment = buildAttachment)
}
}