Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit c062c8f

Browse files
Hanks10100YorkShen
authored andcommitted
[jsfm] Throw the caught exception in componentHook (#2285)
Still throw the caught exception in the "componentHook" anyway, it should be processed by the native for consistent error collecting.
1 parent 83bc0b2 commit c062c8f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

runtime/bridge/receiver.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function fireEvent (document, nodeId, type, event, domChanges, params) {
2323
const el = document.getRef(nodeId)
2424
if (el) {
2525
return document.fireEvent(el, type, event, domChanges, params)
26-
} else if (event) {
26+
}
27+
else if (event) {
2728
event._nodeId = nodeId
2829
return document.fireEvent(document.getRef('_documentElement'), type, event, domChanges, params)
2930
}
@@ -44,6 +45,10 @@ function componentHook (document, componentId, type, hook, args) {
4445
}
4546
catch (e) {
4647
console.error(`[JS Framework] Failed to trigger the "${type}@${hook}" hook on ${componentId}.`)
48+
49+
// Still throw the exception anyway, it should be caught
50+
// and processed by the native for consistent error collecting.
51+
throw e
4752
}
4853
return result
4954
}

0 commit comments

Comments
 (0)