diff --git a/docs/changelog.md b/docs/changelog.md index 85849d94..afd9108c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,6 @@ ## Unreleased +- Show Output button when there are errors while running action or agent package commands - Show datasource configuration status in the tree - Add Data Sources to the Packages tree - Hover (tree item) action in root element to Setup all Data Sources diff --git a/sema4ai/vscode-client/src/robo/actionPackage.ts b/sema4ai/vscode-client/src/robo/actionPackage.ts index aeeed9a2..ecc0b2a3 100644 --- a/sema4ai/vscode-client/src/robo/actionPackage.ts +++ b/sema4ai/vscode-client/src/robo/actionPackage.ts @@ -956,7 +956,6 @@ export async function createActionPackage(agentPackage?: LocalPackageMetadataInf } catch (err) { const errorMsg = "Error creating Action Package at: " + targetDir; logError(errorMsg, err, "ERR_CREATE_ACTION_PACKAGE"); - OUTPUT_CHANNEL.appendLine(errorMsg); window.showErrorMessage(errorMsg + " (see `OUTPUT > Sema4.ai` for more details)."); } } @@ -1015,7 +1014,7 @@ const buildPackage = async (workspaceDir: string, outputDir: string): Promise { return; } } catch (error) { - window.showErrorMessage(`Failed to publish action package: ${error.message}`); + showErrorMessageWithShowOutputButton("Failed to publish action package"); return; } finally { try { diff --git a/sema4ai/vscode-client/src/robo/agentPackage.ts b/sema4ai/vscode-client/src/robo/agentPackage.ts index 7a5e0d07..9e7aa5aa 100644 --- a/sema4ai/vscode-client/src/robo/agentPackage.ts +++ b/sema4ai/vscode-client/src/robo/agentPackage.ts @@ -9,6 +9,7 @@ import { getWorkspacePackages, PackageTargetAndNameResult, revealInExtension, + showErrorMessageWithShowOutputButton, } from "../common"; import { ActionResult, LocalPackageMetadataInfo, PackageType, PackageYamlName } from "../protocols"; import * as roboCommands from "../robocorpCommands"; @@ -98,8 +99,7 @@ export const importAgentPackage = async (): Promise => { } catch (err) { const errorMsg = "Error importing Agent Package. Target: " + targetDir + " File: " + uriResult; logError(errorMsg, err, "ERR_IMPORT_ACTION_PACKAGE"); - OUTPUT_CHANNEL.appendLine(errorMsg); - window.showErrorMessage(errorMsg + " (see `OUTPUT > Sema4.ai` for more details)."); + showErrorMessageWithShowOutputButton(errorMsg); } }; @@ -133,8 +133,7 @@ export const createAgentPackage = async (): Promise => { } catch (err) { const errorMsg = "Error creating Agent Package at: " + targetDir; logError(errorMsg, err, "ERR_CREATE_ACTION_PACKAGE"); - OUTPUT_CHANNEL.appendLine(errorMsg); - window.showErrorMessage(errorMsg + " (see `OUTPUT > Sema4.ai` for more details)."); + showErrorMessageWithShowOutputButton(errorMsg); } }; @@ -153,10 +152,7 @@ export const packAgentPackage = async (targetDir: string): Promise<{ zipPath: st } catch (error) { const errorMsg = `Failed to package the agent at: ${targetDir}`; logError(errorMsg, error, "ERR_PACK_ACTION_PACKAGE"); - - const detailedErrorMsg = `${errorMsg}. Please check the 'OUTPUT > Sema4.ai' for more details.`; - OUTPUT_CHANNEL.appendLine(detailedErrorMsg); - window.showErrorMessage(detailedErrorMsg); + showErrorMessageWithShowOutputButton(errorMsg); } return null; @@ -252,10 +248,7 @@ export const updateAgentVersion = async (agentPath: string): Promise => { } catch (error) { const errorMsg = `Failed to update the agent at: ${agentPath}`; logError(errorMsg, error, "ERR_UPDATE_AGENT_VERSION"); - - const detailedErrorMsg = `${errorMsg}. Please check the 'OUTPUT > Sema4.ai' for more details.`; - OUTPUT_CHANNEL.appendLine(detailedErrorMsg); - window.showErrorMessage(detailedErrorMsg); + showErrorMessageWithShowOutputButton(errorMsg); } }; @@ -286,9 +279,6 @@ export const refreshAgentSpec = async (agentPath: string): Promise => { } catch (error) { const errorMsg = `Failed to refresh the Agent Configuration`; logError(errorMsg, error, "ERR_REFRESH_AGENT_SPEC"); - - const detailedErrorMsg = `${errorMsg}. Please check the 'OUTPUT > Sema4.ai' for more details.`; - OUTPUT_CHANNEL.appendLine(detailedErrorMsg); - window.showErrorMessage(detailedErrorMsg); + showErrorMessageWithShowOutputButton(errorMsg); } };