MCPcopy Index your code
hub / github.com/SchemaStore/schemastore / printErrorAndExit

Function printErrorAndExit

cli.js:390–409  ·  view source on GitHub ↗

* @param {unknown} error * @param {string[]} [messages] * @param {string} [extraText] * @returns {never}

(error, messages, extraText)

Source from the content-addressed store, hash-verified

388 * @returns {never}
389 */
390function printErrorAndExit(error, messages, extraText) {
391 if (Array.isArray(messages) && messages.length > 0) {
392 console.warn('---')
393 for (const msg of messages) {
394 console.error(chalk.red('>>') + ' ' + msg)
395 }
396 }
397
398 if (extraText) {
399 process.stderr.write(extraText)
400 process.stderr.write('\n')
401 }
402
403 console.warn('---')
404 if (error instanceof Error && error?.stack) {
405 process.stderr.write(error.stack)
406 process.stderr.write('\n')
407 }
408 process.exit(1)
409}
410
411function getSchemaDialect(/** @type {string} */ schemaUrl) {
412 const schemaDialect = SchemaDialects.find((obj) => schemaUrl === obj.url)

Callers 15

forEachFileFunction · 0.85
readDataFileFunction · 0.85
onSchemaFileFunction · 0.85
onNegativeTestFileFunction · 0.85
taskCheckStrictFunction · 0.85
assertFileSystemIsValidFunction · 0.85
onTestDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected