(
workspace: string,
opts: { slackChannel?: string } = {}
)
| 572 | } |
| 573 | |
| 574 | export async function loadOrBail( |
| 575 | workspace: string, |
| 576 | opts: { slackChannel?: string } = {} |
| 577 | ): Promise<AgentManager> { |
| 578 | try { |
| 579 | return await AgentManager.load(workspace, opts); |
| 580 | } catch (err) { |
| 581 | if (err instanceof PlanValidationError) { |
| 582 | console.error(err.message); |
| 583 | process.exit(2); |
| 584 | } |
| 585 | console.error(errorStackOrMessage(err)); |
| 586 | process.exit(2); |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | export function bail(msg: string): never { |
| 591 | console.error(msg); |
no test coverage detected