Python: introduce failure as a sugar over Result.failure(Throwable(userVisibleText))

GitOrigin-RevId: cefb5234d830f4e306e385161dd07d35eb12989b
This commit is contained in:
Ilya.Kazakevich
2024-09-11 19:37:53 +02:00
committed by intellij-monorepo-bot
parent 1760e006dc
commit 6a9aebe3e6
4 changed files with 16 additions and 5 deletions

View File

@@ -0,0 +1,8 @@
package com.jetbrains.extensions
import com.intellij.openapi.util.NlsSafe
/**
* [Result] failure with user-readable error
*/
fun <T> failure(error: @NlsSafe String): Result<T> = Result.failure(Throwable(error))