mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
Add error formating params (#4629)
This commit is contained in:

committed by
GitHub

parent
3916954175
commit
92bb46f4f9
@ -12,14 +12,11 @@
|
||||
// template literal strings. The messages will be replaced with error codes
|
||||
// during build.
|
||||
|
||||
function formatProdErrorMessage(code, adj, noun) {
|
||||
function formatProdErrorMessage(code) {
|
||||
const params = new URLSearchParams();
|
||||
params.append('code', code);
|
||||
if (adj != null) {
|
||||
params.append('a', adj);
|
||||
}
|
||||
if (noun != null) {
|
||||
params.append('n', noun);
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
params.append('v', arguments[i]);
|
||||
}
|
||||
throw Error(
|
||||
`Minified Lexical error #${code}; visit https://lexical.dev/docs/error?${params} for the full message or ` +
|
||||
|
Reference in New Issue
Block a user