W n8n
This commit is contained in:
parent
7a5e68f0c8
commit
2be19ea579
@ -469,11 +469,14 @@ export async function POST(request: Request) {
|
||||
rocketChatChannel: !!missionResponse.rocketChatChannelId
|
||||
},
|
||||
resourceStatus: {
|
||||
gitRepo: true,
|
||||
gitRepo: false,
|
||||
leantimeProject: true,
|
||||
docCollection: true,
|
||||
rocketChatChannel: true
|
||||
}
|
||||
},
|
||||
errors: [
|
||||
'Git repository creation failed: Unknown error'
|
||||
]
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error creating mission:', error);
|
||||
|
||||
@ -93,6 +93,28 @@ export class N8nService {
|
||||
try {
|
||||
const result = JSON.parse(responseText);
|
||||
console.log('Parsed workflow result:', JSON.stringify(result, null, 2));
|
||||
|
||||
// Check if the response contains error information
|
||||
if (result.error || result.message?.includes('failed')) {
|
||||
// Extract which services failed from the error message
|
||||
const errorMessage = result.message || result.error;
|
||||
const failedServices = {
|
||||
gitRepo: errorMessage.includes('Git repository creation failed'),
|
||||
leantimeProject: errorMessage.includes('Leantime project creation failed'),
|
||||
docCollection: errorMessage.includes('Documentation collection creation failed'),
|
||||
rocketChatChannel: errorMessage.includes('RocketChat channel creation failed')
|
||||
};
|
||||
|
||||
// Return success with partial results
|
||||
return {
|
||||
success: true,
|
||||
results: {
|
||||
...result,
|
||||
failedServices
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
results: result
|
||||
|
||||
Loading…
Reference in New Issue
Block a user