Add error formating params (#4627)

This commit is contained in:
Maksim Horbachevsky
2023-06-09 13:06:43 -04:00
committed by GitHub
parent 81e9bf404f
commit c315ac91f8
2 changed files with 21 additions and 4 deletions

View File

@ -12,9 +12,17 @@
// template literal strings. The messages will be replaced with error codes
// during build.
function formatProdErrorMessage(code) {
function formatProdErrorMessage(code, adj, noun) {
const params = new URLSearchParams();
params.append('code', code);
if (adj != null) {
params.append('a', adj);
}
if (noun != null) {
params.append('n', noun);
}
throw Error(
`Minified Lexical error #${code}; visit https://lexical.dev/docs/error?code=${code} for the full message or ` +
`Minified Lexical error #${code}; visit https://lexical.dev/docs/error?${params} for the full message or ` +
'use the non-minified dev environment for full errors and additional ' +
'helpful warnings.',
);