<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Messages",
  "identifier" : "/documentation/Messages/MSMessageErrorCode",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Messages"
    ],
    "preciseIdentifier" : "c:@E@MSMessageErrorCode"
  },
  "title" : "MSMessageErrorCode"
}
-->

# MSMessageErrorCode

The error codes that the Messages framework generates.

```
enum MSMessageErrorCode
```

## Topics

### Error Codes

[`MSMessageErrorCodeFileNotFound`](/documentation/Messages/MSMessageErrorCode/fileNotFound)

The file could not be found.

[`MSMessageErrorCodeFileUnreadable`](/documentation/Messages/MSMessageErrorCode/fileUnreadable)

The file could not be read.

[`MSMessageErrorCodeImproperFileType`](/documentation/Messages/MSMessageErrorCode/improperFileType)

The file is not a supported file type.

[`MSMessageErrorCodeImproperFileURL`](/documentation/Messages/MSMessageErrorCode/improperFileURL)

The URL does not refer to a local file.

[`MSMessageErrorCodeStickerFileImproperFileAttributes`](/documentation/Messages/MSMessageErrorCode/stickerFileImproperFileAttributes)

The system cannot read one or more of the file’s attributes (for example, the file size).

[`MSMessageErrorCodeStickerFileImproperFileSize`](/documentation/Messages/MSMessageErrorCode/stickerFileImproperFileSize)

The image used to create an [`MSSticker`](/documentation/Messages/MSSticker) object is larger than 500 KB.

[`MSMessageErrorCodeStickerFileImproperFileFormat`](/documentation/Messages/MSMessageErrorCode/stickerFileImproperFileFormat)

The image used to create an [`MSSticker`](/documentation/Messages/MSSticker) object is not one of the supported file types (PNG, APNG, GIF, or JPEG).

[`MSMessageErrorCodeURLExceedsMaxSize`](/documentation/Messages/MSMessageErrorCode/urlExceedsMaxSize)

The URL in an [`MSMessage`](/documentation/Messages/MSMessage) object’s [`url`](/documentation/Messages/MSMessage/url) property is longer than the maximum allowed length (5,000 characters).

[`MSMessageErrorCodeSendWhileNotVisible`](/documentation/Messages/MSMessageErrorCode/sendWhileNotVisible)

A message was sent while the app was not visible.

[`MSMessageErrorCodeSendWithoutRecentInteraction`](/documentation/Messages/MSMessageErrorCode/sendWithoutRecentInteraction)

A message was sent, but the app has not registered a recent touch interaction from the user.

[`MSMessageErrorCodeAPIUnavailableInPresentationContext`](/documentation/Messages/MSMessageErrorCode/apiUnavailableInPresentationContext)

The API is unavailable in the current context.

[`MSMessageErrorCodeUnknown`](/documentation/Messages/MSMessageErrorCode/unknown)

An unexpected or unknown error has occurred.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Sendable`](/documentation/Swift/Sendable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)