summaryrefslogtreecommitdiffstats
path: root/base/mac/scoped_nsexception_enabler.mm
diff options
context:
space:
mode:
Diffstat (limited to 'base/mac/scoped_nsexception_enabler.mm')
-rw-r--r--base/mac/scoped_nsexception_enabler.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/mac/scoped_nsexception_enabler.mm b/base/mac/scoped_nsexception_enabler.mm
index 9898789..44d4e19 100644
--- a/base/mac/scoped_nsexception_enabler.mm
+++ b/base/mac/scoped_nsexception_enabler.mm
@@ -50,6 +50,17 @@ id PerformSelectorIgnoringExceptions(NSObject* target, SEL sel) {
return ret;
}
+id RunBlockIgnoringExceptions(BlockReturningId block) {
+ id ret = nil;
+ @try {
+ base::mac::ScopedNSExceptionEnabler enable;
+ ret = block();
+ }
+ @catch(id exception) {
+ }
+ return ret;
+}
+
ScopedNSExceptionEnabler::ScopedNSExceptionEnabler() {
was_enabled_ = GetNSExceptionsAllowed();
SetNSExceptionsAllowed(true);