# Throwables

Added in 2.0.5

*** ** * ** ***


```
public final class Throwables
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/tracing/Throwables#(androidx.tracing.Tracer).recordExceptionAndThrow(kotlin.String,kotlin.String,kotlin.Throwable)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/tracing/Tracer receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html category, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html throwable )` Records an exceptional event in a trace. |

## Public methods

### recordExceptionAndThrow

Artifact: [androidx.tracing:tracing](https://developer.android.com/jetpack/androidx/releases/tracing) [View Source](https://cs.android.com/search?q=file:androidx/tracing/Throwable.kt+function:recordExceptionAndThrow) Added in [2.0.5](https://developer.android.com/jetpack/androidx/releases/tracing#2.0.5)

```
public static final @NonNull Void recordExceptionAndThrow(
    @NonNull Tracer receiver,
    @NonNull String category,
    @NonNull String name,
    @NonNull Throwable throwable
)
```

Records an exceptional event in a trace. This method rethrows the `https://developer.android.com/reference/androidx/tracing/package-summary#(androidx.tracing.Tracer).recordExceptionAndThrow(kotlin.String,kotlin.String,kotlin.Throwable)` after having extracting all metadata worth tracing.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html category` | The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` category. It's useful to categorize `https://developer.android.com/reference/androidx/tracing/TraceEvent`s, so that they can be filtered if necessary using the appropriate trace configuration. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name` | The name of the trace section. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html throwable` | The exception thrown by a block of code. |