Usage of NSError deprecated in favor of Error and LocalizedError protocols?
<p>I would like some clarification over the direction of the usage of <code>NSError</code> class versus creating a custom enum, struct, or class that conforms to the <code>Error</code> or <code>LocalizedError</code> protocols. Is it true that the support in Foundation for NSError is there for legacy purposes in order to make the transition easier for converting or interfacing to existing from Swift 2 (or ObjC) code?</p>

<p>For new code, should I just prefer to not use NSError if possible? </p>

<p>To set the context, I mostly develop server-side Linux Swift 3 code not iOS. Although I have experience with iOS development.</p>