<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/nsnetservices-errors",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "NSNetServices Errors"
}
-->

# NSNetServices Errors

If an error occurs, the delegate error-handling methods return a dictionary with the following keys.

## Topics

### Constants

[`class let errorCode: String`](/documentation/Foundation/NetService/errorCode-swift.type.property)

This key identifies the error that occurred during the most recent operation.

[`class let errorDomain: String`](/documentation/Foundation/NetService/errorDomain)

This key identifies the originator of the error, which is either the `NSNetService` object or the mach network layer. For most errors, you should not need the value provided by this key.



---

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)