mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
Introduce invariant error code system (#339)
This commit is contained in:

committed by
acywatson

parent
5f94878bad
commit
a457a3850d
22
scripts/error-codes/formatProdErrorMessage.js
Normal file
22
scripts/error-codes/formatProdErrorMessage.js
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
// Do not require this module directly! Use normal `invariant` calls with
|
||||
// template literal strings. The messages will be replaced with error codes
|
||||
// during build.
|
||||
|
||||
function formatProdErrorMessage(code) {
|
||||
throw new Error(
|
||||
`Minified Outline error #${code}; see codes.json for the full message or ` +
|
||||
'use the non-minified dev environment for full errors and additional ' +
|
||||
'helpful warnings.',
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = formatProdErrorMessage;
|
Reference in New Issue
Block a user