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

Commit

Permalink
[jsfm] Throw the caught exception in componentHook (#2285)
Browse files Browse the repository at this point in the history
Still throw the caught exception in the "componentHook" anyway, it should
be processed by the native for consistent error collecting.
  • Loading branch information
Hanks10100 authored and YorkShen committed Apr 10, 2019
1 parent 83bc0b2 commit c062c8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runtime/bridge/receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ function fireEvent (document, nodeId, type, event, domChanges, params) {
const el = document.getRef(nodeId)
if (el) {
return document.fireEvent(el, type, event, domChanges, params)
} else if (event) {
}
else if (event) {
event._nodeId = nodeId
return document.fireEvent(document.getRef('_documentElement'), type, event, domChanges, params)
}
Expand All @@ -44,6 +45,10 @@ function componentHook (document, componentId, type, hook, args) {
}
catch (e) {
console.error(`[JS Framework] Failed to trigger the "${type}@${hook}" hook on ${componentId}.`)

// Still throw the exception anyway, it should be caught
// and processed by the native for consistent error collecting.
throw e
}
return result
}
Expand Down

0 comments on commit c062c8f

Please sign in to comment.