Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
358 B
Objective-C
14 lines
358 B
Objective-C
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#import "SPKTry.h"
|
|
|
|
NSString *_Nullable SPKTry(NS_NOESCAPE void (^block)(void)) {
|
|
@try {
|
|
block();
|
|
return nil;
|
|
} @catch (NSException *e) {
|
|
return [NSString stringWithFormat:@"%@: %@", e.name, e.reason ?: @"(no reason)"];
|
|
}
|
|
}
|