diff options
author | ethe <joshh@protonmail.ch> | 2015-12-15 19:36:53 +0000 |
---|---|---|
committer | ethe <joshh@protonmail.ch> | 2015-12-15 19:36:53 +0000 |
commit | ea8e853365873e7a01da0fcd4ad877e6aa381e10 (patch) | |
tree | 76e936d489642752b70879d9bae29ff384af5133 /macosx | |
parent | 309025c3fb7332a2fb6ca0886ec7bbf3c24861c0 (diff) | |
download | jack2-ea8e853365873e7a01da0fcd4ad877e6aa381e10.tar.gz |
Updated deprecated error handling function
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/coremidi/JackCoreMidiUtil.mm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/macosx/coremidi/JackCoreMidiUtil.mm b/macosx/coremidi/JackCoreMidiUtil.mm index d976e936..a93a4658 100644 --- a/macosx/coremidi/JackCoreMidiUtil.mm +++ b/macosx/coremidi/JackCoreMidiUtil.mm @@ -25,13 +25,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. std::string Jack::GetMacOSErrorString(OSStatus status) { - const char *message = GetMacOSStatusErrorString(status); - if (! message) { - std::stringstream stream; - stream << "error (code: '" << status << "')"; - return stream.str(); + NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil]; + NSString *errorString = [error localizedDescription]; + std::string returnString; + if (errorString){ + returnString = std::string([errorString UTF8String]); + } else { + returnString = std::string("No error"); } - return std::string(message); + return returnString; } void |