Contents

cancelRequest(withError:)

Cancels a request with an error.

Declaration

func cancelRequest(withError error: any Error)

Parameters

  • error:

    An error that indicates the reason for the canceled request.

Mentioned in

Discussion

If the user cancels the request, use the ASExtensionError.Code.userCanceled error code in the error. If the request requires user interaction, use ASExtensionError.Code.userInteractionRequired instead.

To include additional information regarding the failure, use ASExtensionLocalizedFailureReasonErrorKey to set a string value in the error’s userInfo dictionary. The system displays this string value to the user.

See Also

Handling Requests