Skip to content

Commit

Permalink
Improve Firefox logging a little more
Browse files Browse the repository at this point in the history
Summary:
As title. `message` was an empty string but stringifying an NS_ERROR_FAILURE gives a result more like

```
[Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: wuxoyuzore.js :: <TOP_LEVEL> :: line 23" data: no]
```

Reviewed By: flarnie

Differential Revision: D5802539

fbshipit-source-id: 197c08cc37ab9e1f873ddc734a00231570d1cbd0
  • Loading branch information
sophiebits authored and facebook-github-bot committed Sep 11, 2017
1 parent 23c8d29 commit 2bf55e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/component/selection/setDraftEditorSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function addFocusToSelection(
}

// logging to catch bug that is being reported in t18110632
const nodeWasFocus = node === selection.focusNode;
try {
selection.extend(node, offset);
} catch (e) {
Expand All @@ -274,6 +275,8 @@ function addFocusToSelection(
extraParams: JSON.stringify(
{
activeElementName: activeElement ? activeElement.nodeName : null,
nodeIsFocus: node === selection.focusNode,
nodeWasFocus: nodeWasFocus,
selectionRangeCount: selection.rangeCount,
selectionAnchorNodeName: selection.anchorNode
? selection.anchorNode.nodeName
Expand All @@ -283,7 +286,7 @@ function addFocusToSelection(
? selection.focusNode.nodeName
: null,
selectionFocusOffset: selection.focusOffset,
message: e ? e.message : null,
message: e ? '' + e : null,
offset: offset,
},
null,
Expand Down

0 comments on commit 2bf55e4

Please sign in to comment.