# ImageCaptureException

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/ImageCaptureException.java+class:androidx.camera.core.ImageCaptureException) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

*** ** * ** ***


```
class ImageCaptureException : Exception
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [androidx.camera.core.ImageCaptureException](https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureException) |

*** ** * ** ***

An exception thrown to indicate an error has occurred during image capture or while saving the captured image. See `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OnImageCapturedCallback` and `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OnImageSavedCallback`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureException#ImageCaptureException(int,java.lang.String,java.lang.Throwable)( imageCaptureError: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html? )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureException#getImageCaptureError()()` Returns the type of the image capture error. |

| ### Inherited functions |
|---|
| From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/set-stack-trace.html(stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/to-string.html()` | |

## Public constructors

### ImageCaptureException

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

```
ImageCaptureException(
    imageCaptureError: Int,
    message: String,
    cause: Throwable?
)
```

## Public functions

### getImageCaptureError

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

```
fun getImageCaptureError(): Int
```

Returns the type of the image capture error.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The image capture error type, can have one of the following values: `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#ERROR_UNKNOWN()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#ERROR_FILE_IO()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#ERROR_CAPTURE_FAILED()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#ERROR_CAMERA_CLOSED()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#ERROR_INVALID_CAMERA()`. |