Skip to main content

Module error

Module error 

Source
Expand description

Error type for Foundation.

Corresponds to Foundation/NSError.hpp.

§C++ Equivalent

namespace NS {
using ErrorDomain = class String*;

_NS_CONST(ErrorDomain, CocoaErrorDomain);
_NS_CONST(ErrorDomain, POSIXErrorDomain);
_NS_CONST(ErrorDomain, OSStatusErrorDomain);
_NS_CONST(ErrorDomain, MachErrorDomain);

using ErrorUserInfoKey = class String*;

_NS_CONST(ErrorUserInfoKey, UnderlyingErrorKey);
_NS_CONST(ErrorUserInfoKey, LocalizedDescriptionKey);
_NS_CONST(ErrorUserInfoKey, LocalizedFailureReasonErrorKey);
_NS_CONST(ErrorUserInfoKey, LocalizedRecoverySuggestionErrorKey);
_NS_CONST(ErrorUserInfoKey, LocalizedRecoveryOptionsErrorKey);
_NS_CONST(ErrorUserInfoKey, RecoveryAttempterErrorKey);
_NS_CONST(ErrorUserInfoKey, HelpAnchorErrorKey);
_NS_CONST(ErrorUserInfoKey, DebugDescriptionErrorKey);
_NS_CONST(ErrorUserInfoKey, LocalizedFailureErrorKey);
_NS_CONST(ErrorUserInfoKey, StringEncodingErrorKey);
_NS_CONST(ErrorUserInfoKey, URLErrorKey);
_NS_CONST(ErrorUserInfoKey, FilePathErrorKey);

class Error : public Copying<Error> {
public:
    static Error*     error(ErrorDomain domain, Integer code, class Dictionary* pDictionary);
    static Error*     alloc();
    Error*            init();
    Error*            init(ErrorDomain domain, Integer code, class Dictionary* pDictionary);
    Integer           code() const;
    ErrorDomain       domain() const;
    class Dictionary* userInfo() const;
    class String*     localizedDescription() const;
    class Array*      localizedRecoveryOptions() const;
    class String*     localizedRecoverySuggestion() const;
    class String*     localizedFailureReason() const;
};
}

Structs§

Error
An Objective-C error object.

Functions§

cocoa_error_domain
Get the Cocoa error domain.
debug_description_error_key
Get the debug description error key.
file_path_error_key
Get the file path error key.
help_anchor_error_key
Get the help anchor error key.
localized_description_key
Get the localized description key.
localized_failure_error_key
Get the localized failure error key.
localized_failure_reason_error_key
Get the localized failure reason error key.
localized_recovery_options_error_key
Get the localized recovery options error key.
localized_recovery_suggestion_error_key
Get the localized recovery suggestion error key.
mach_error_domain
Get the Mach error domain.
os_status_error_domain
Get the OSStatus error domain.
posix_error_domain
Get the POSIX error domain.
recovery_attempter_error_key
Get the recovery attempter error key.
string_encoding_error_key
Get the string encoding error key.
underlying_error_key
Get the underlying error key.
url_error_key
Get the URL error key.

Type Aliases§

ErrorDomain
Error domain type (alias for String pointer).
ErrorUserInfoKey
Error user info key type (alias for String pointer).