Introduce invariant error code system (#339)

This commit is contained in:
Dominic Gannaway
2021-05-25 18:51:28 +01:00
committed by acywatson
parent 5f94878bad
commit a457a3850d
16 changed files with 506 additions and 274 deletions

View 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;