SorobanClientError
public enum SorobanClientError : Error, Sendable
Errors that can occur during high-level SorobanClient operations.
These errors represent failures in contract installation, deployment, and invocation operations performed through SorobanClient.
Error cases:
- deployFailed: Contract deployment failed
- installFailed: Contract installation (WASM upload) failed
- invokeFailed: Contract method invocation failed
- methodNotFound: Attempted to invoke a non-existent contract method
Example error handling:
do {
let result = try await client.invokeMethod(
name: "transfer",
args: [from, to, amount]
)
print("Success: \(result)")
} catch SorobanClientError.invokeFailed(let message) {
print("Invocation failed: \(message)")
} catch SorobanClientError.methodNotFound(let message) {
print("Method not found: \(message)")
} catch {
print("Other error: \(error)")
}
See also:
- [SorobanClient] for operations that may throw these errors
-
Contract deployment operation failed with the specified error details.
Declaration
Swift
case deployFailed(message: String) -
Contract WASM installation operation failed with the specified error details.
Declaration
Swift
case installFailed(message: String) -
Contract method invocation failed with the specified error details.
Declaration
Swift
case invokeFailed(message: String) -
Attempted to invoke a contract method that does not exist in the contract specification.
Declaration
Swift
case methodNotFound(message: String)
View on GitHub
Install in Dash