Skip to content

Commit

Permalink
Merge pull request #2167 from posit-dev/remove-some-straggling-throws
Browse files Browse the repository at this point in the history
Remove some throws which were left in the web view
  • Loading branch information
sagerb authored Aug 23, 2024
2 parents 0c7f618 + 72cc47f commit 3325457
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions extensions/vscode/webviews/homeView/src/HostConduitService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ export function useHostConduitService() {

const sendMsg = (msg: WebviewToHostMessage) => {
if (!hostConduit) {
throw new Error(
"HostCondiutService::sendMsg attemped ahead of call to useHostConduitService",
console.error(
`HostCondiutService::sendMsg attempted ahead of call to useHostConduitService. Message Dropped: ${JSON.stringify(msg)}`,
);
return;
}
console.debug(`HostConduitService - Sending Msg: ${JSON.stringify(msg)}`);
return hostConduit.sendMsg(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ const deploy = () => {
!home.selectedConfiguration ||
!home.serverCredential
) {
throw new Error(
"DeployButton::deploy trying to send message with undefined values",
console.error(
"DeployButton::deploy trying to send message with undefined values. Action ignored.",
);
return;
}
hostConduit.sendMsg({
Expand Down
5 changes: 4 additions & 1 deletion extensions/vscode/webviews/homeView/src/utils/hostConduit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export class HostConduit {
if (isHostToWebviewMessage(obj)) {
this.externalMsgCB(obj);
} else {
throw new Error(`NonConduitMessage Received: ${JSON.stringify(e)}`);
console.error(
`HostConduit::rawMsgCB, NonConduitMessage Received: ${JSON.stringify(e)}`,
);
return;
}
}
};
Expand Down

0 comments on commit 3325457

Please sign in to comment.