SubmitError

scalus.cardano.node.SubmitError
See theSubmitError companion trait
object SubmitError

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

Create a SubmitError from a TransactionException.

Create a SubmitError from a TransactionException.

This is used by the Emulator to map internal validation exceptions to SubmitError.

Two exceptions are folded into NodeSubmitError.UtxoNotAvailable: BadInputsUTxO and the union case BadAllInputsUTxO, which is the one that populates unavailableInputs. Those two really are one condition – an input this transaction spends is gone, the race a caller retries on. BadCollateralInputsUTxO (a wallet problem) and BadReferenceInputsUTxO (a script the transaction points at is not there) are not that condition, so they keep their own rule names through NodeSubmitError.ValidationError.errorCode like every other unclassified rejection.

Both script exceptions do stay one case, NodeSubmitError.ScriptFailure: "a script this transaction carries did not validate" is a single thing to branch on, logs, scriptHash and spentBudget are declared optional precisely because a native script produces none of them, and parseValidationError cannot tell native from Plutus in a provider's error body either – splitting here would put the two paths back on different vocabularies.

Everything else keeps its rule name through NodeSubmitError.ValidationError.errorCode, so an unclassified rejection is "FeesOk" or "MissingKeyHashes" rather than an anonymous "ValidationError".

Attributes

def fromHttpResponse(statusCode: Int, message: String): SubmitError

Create a SubmitError from an HTTP status code and message.

Create a SubmitError from an HTTP status code and message.

This is used by HTTP-based providers like Blockfrost to classify errors based on status codes and error message patterns.

Attributes

def parseValidationError(message: String): SubmitError

Parse a validation error message to classify it into a specific SubmitError type.

Parse a validation error message to classify it into a specific SubmitError type.

This attempts to match known Cardano ledger error patterns.

The classification it produces is the same vocabulary the emulator's fromException produces, so SubmitError.rule means the same thing whichever provider a caller is pointed at. Only the NodeSubmitError.ValidationError fallback differs: its errorCode is whatever extractErrorCode could find in the provider's own prose, which is not the emulator's ledger-rule vocabulary.

Attributes

Concrete fields

val AuthenticationError: AuthenticationError.type
val Banned: Banned.type
val ConnectionError: ConnectionError.type
val InternalError: InternalError.type
val MempoolFull: MempoolFull.type
val RateLimited: RateLimited.type
val ScriptFailure: ScriptFailure.type
val TransactionExpired: TransactionExpired.type
val UtxoNotAvailable: UtxoNotAvailable.type
val ValidationError: ValidationError.type
val ValueNotConserved: ValueNotConserved.type