Skip to content

Commit f37ebce

Browse files
committed
fix(reactant): handle checkAction error
1 parent 5053b53 commit f37ebce

File tree

1 file changed

+10
-6
lines changed
  • packages/reactant-module/src/decorators

1 file changed

+10
-6
lines changed

packages/reactant-module/src/decorators/action.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ const action = (
5858
);
5959
}
6060
if (typeof ref.checkAction === 'function') {
61-
ref.checkAction({
62-
target: this,
63-
ref,
64-
method: key,
65-
args,
66-
});
61+
try {
62+
ref.checkAction({
63+
target: this,
64+
ref,
65+
method: key,
66+
args,
67+
});
68+
} catch (error) {
69+
console.error(error);
70+
}
6771
} else if (__DEV__ && ref.checkAction !== undefined) {
6872
throw new Error(
6973
`The method '${key}' decorated by '@action' must be checked by 'checkAction' option function.`

0 commit comments

Comments
 (0)