Skip to content

Commit

Permalink
add error code as review
Browse files Browse the repository at this point in the history
  • Loading branch information
2wheeh committed May 10, 2024
1 parent 95aaee0 commit 8db554d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/lexical-text/src/registerLexicalTextEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ export function registerLexicalTextEntity<T extends TextNode>(

invariant(
nodeToReplace !== undefined,
'nodeToReplace should not be undefined. You may want to check splitOffsets passed to the splitText.',
'%s should not be undefined. You may want to check splitOffsets passed to the splitText.',
'nodeToReplace',
);

const replacementNode = createNode(nodeToReplace);
Expand Down
3 changes: 2 additions & 1 deletion scripts/error-codes/codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,6 @@
"161": "Unexpected dirty selection to be null",
"162": "Root element not registered",
"163": "node is not a ListNode",
"164": "Root element count less than 0"
"164": "Root element count less than 0",
"165": "%s should not be undefined. You may want to check splitOffsets passed to the splitText."
}

0 comments on commit 8db554d

Please sign in to comment.