Skip to content

Commit

Permalink
fix: throw err when bridge or agent misconfigured
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Dec 9, 2024
1 parent 6387425 commit 07c0d06
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/handlers/call-personal-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ export async function callPersonalAgent(context: Context) {
const personalAgentConfig = await getPersonalAgentConfig(context, personalAgentOwner);

if (!personalAgentConfig.config) {
console.log(`No personal agent config found on ${personalAgentOwner}/personal-agent`);
return;
throw new Error(`No personal agent config found on ${personalAgentOwner}/personal-agent`);
}

if (!process.env.PA_BRIDGE_X25519_PRIVATE_KEY) {
console.log(`Missing PA_BRIDGE_X25519_PRIVATE_KEY in bridge repository env.`);
return;
throw new Error(`Missing PA_BRIDGE_X25519_PRIVATE_KEY in bridge repository env.`);
}

const patDecrypted = await decryptKeys(personalAgentConfig.config.GITHUB_PAT_ENCRYPTED, process.env.PA_BRIDGE_X25519_PRIVATE_KEY, logger);
Expand Down

0 comments on commit 07c0d06

Please sign in to comment.