MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / checkLogsForErrors

Function checkLogsForErrors

packages/cli-v3/src/commands/deploy.ts:621–654  ·  view source on GitHub ↗
(logs: string)

Source from the content-addressed store, hash-verified

619
620// Try to extract useful error messages from the logs
621function checkLogsForErrors(logs: string) {
622 const errors: LogParserOptions = [
623 {
624 regex: /Error: Provided --schema at (?<schema>.*) doesn't exist/,
625 message: `Prisma generate failed to find the specified schema at "$schema".\nDid you include it in config.additionalFiles? ${terminalLink(
626 "Config docs",
627 docs.config.prisma
628 )}`,
629 },
630 {
631 regex: /sh: 1: (?<packageOrBinary>.*): not found/,
632 message: `$packageOrBinary not found\n\nIf it's a package: Include it in ${terminalLink(
633 "config.additionalPackages",
634 docs.config.prisma
635 )}\nIf it's a binary: Please ${terminalLink(
636 "get in touch",
637 getInTouch
638 )} and we'll see what we can do!`,
639 },
640 ];
641
642 for (const error of errors) {
643 const matches = logs.match(error.regex);
644
645 if (!matches) {
646 continue;
647 }
648
649 const message = getMessageFromTemplate(error.message, matches.groups);
650
651 log.error(`${chalkError("Error:")} ${message}`);
652 break;
653 }
654}
655
656function getMessageFromTemplate(template: string, replacer: RegExpMatchArray["groups"]) {
657 let message = template;

Callers 1

failDeployFunction · 0.85

Calls 3

chalkErrorFunction · 0.90
getMessageFromTemplateFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…