Skip to content

Commit 6ddba30

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Remove unused exception parameter from react (#54503)
Summary: Pull Request resolved: #54503 `-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it. This: ``` try { ... } catch (exception& e) { // no use of e } ``` should instead be written as ``` } catch (exception&) { ``` If the code compiles, this is safe to land. Reviewed By: javache Differential Revision: D86823891 fbshipit-source-id: 06e13c0585b671a100b79da51f21931b3b301563
1 parent 85905ad commit 6ddba30

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/react-native/React/Base/RCTAssert.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void RCTFatal(NSError *error)
146146
// userInfo: <underlying error userinfo, plus untruncated description plus JS stack trace>
147147
@throw [[NSException alloc] initWithName:name reason:message userInfo:userInfo];
148148
#if DEBUG
149-
} @catch (NSException *e) {
149+
} @catch (NSException *) {
150150
}
151151
#endif
152152
}
@@ -216,7 +216,7 @@ void RCTFatalException(NSException *exception)
216216
#endif
217217
@throw exception;
218218
#if DEBUG
219-
} @catch (NSException *e) {
219+
} @catch (NSException *) {
220220
}
221221
#endif
222222
}

packages/react-native/React/Base/RCTModuleData.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ - (void)setBridgeForInstance
241241
RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @"[RCTModuleData setBridgeForInstance]", nil);
242242
@try {
243243
[(id)_instance setValue:_bridge forKey:@"bridge"];
244-
} @catch (NSException *exception) {
244+
} @catch (NSException *) {
245245
RCTLogError(
246246
@"%@ has no setter or ivar for its bridge, which is not "
247247
"permitted. You must either @synthesize the bridge property, "
@@ -291,7 +291,7 @@ - (void)setUpMethodQueue
291291
if (implementsMethodQueue) {
292292
@try {
293293
[(id)_instance setValue:_methodQueue forKey:@"methodQueue"];
294-
} @catch (NSException *exception) {
294+
} @catch (NSException *) {
295295
RCTLogError(
296296
@"%@ is returning nil for its methodQueue, which is not "
297297
"permitted. You must either return a pre-initialized "

packages/react-native/React/CxxModule/RCTCxxMethod.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ - (id)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray
129129
// TODO: we should convert this to JSValue directly
130130
return convertFollyDynamicToId(result);
131131
}
132-
} catch (const facebook::xplat::JsArgumentException &ex) {
132+
} catch ([[maybe_unused]] const facebook::xplat::JsArgumentException &ex) {
133133
RCTLogError(
134134
@"Method %@.%s argument error: %s",
135135
RCTBridgeModuleNameForClass([module class]),

0 commit comments

Comments
 (0)