---
title: get()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/result/get()
---

# get()

Returns the success value as a throwing expression.

## Declaration

```swift
consuming func get() throws(Failure) -> Success
```

## Return Value

Return Value The success value, if the instance represents a success.

## Discussion

Discussion Use this method to retrieve the value of this result if it represents a success, or to catch the value if it represents a failure. let integerResult: Result<Int, Error> = .success(5) do {     let value = try integerResult.get()     print("The value is \(value).") } catch {     print("Error retrieving the value: \(error)") } // Prints "The value is 5." note: The failure value, if the instance represents a failure.
