---
title: "exceptionHandler(_:shouldLogException:mask:)"
framework: Objective-C Runtime
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/exceptionhandler(_:shouldlogexception:mask:)"
---

# exceptionHandler(_:shouldLogException:mask:)

Implemented by the delegate to evaluate whether the delegating exception hangler should log a given exception.

## Declaration

```swift
func exceptionHandler(_ sender: NSExceptionHandler!, shouldLogException exception: NSException!, mask aMask: Int) -> Bool
```

## Parameters

- `sender`: The doc://com.apple.documentation/documentation/ExceptionHandling/NSExceptionHandler object sending the message.
- `exception`: An doc://com.apple.documentation/documentation/Foundation/NSException object describing the exception to be evaluated.
- `aMask`: The bit mask indicating the types of exceptions logged by the doc://com.apple.documentation/documentation/ExceptionHandling/NSExceptionHandler object. See Logging and Handling Constants and System Hang Constants for descriptions of the possible enum constants.

## Return Value

Return Value YES to have the NSExceptionHandler object log the exception, NO otherwise.
