From 1e4dd5a2290b74333144f2104cd805ba13bb7f00 Mon Sep 17 00:00:00 2001 From: Ankur Jain Date: Thu, 15 Aug 2024 11:15:39 -0700 Subject: [PATCH] Throw error instead of just printing. This will be caught at a higher level which prevents users from seeing success message on failure. --- packages/core/src/publish/dapp_publisher_portal.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/publish/dapp_publisher_portal.ts b/packages/core/src/publish/dapp_publisher_portal.ts index 2a24ead..1286286 100644 --- a/packages/core/src/publish/dapp_publisher_portal.ts +++ b/packages/core/src/publish/dapp_publisher_portal.ts @@ -68,11 +68,11 @@ export const submitRequestToSolanaDappPublisherPortal = async ( }) .catch((error) => { if (error.response) { - console.error(`ERROR: failed to submit request to dApp publisher portal: ${error.response.status} /`, error.response.data); + throw new Error(`Failed to submit request\nError status code: ${error.response.status}\nError message: ${error.response.data}`); } else if (error.request) { - console.error(`ERROR: failed sending request to dApp publisher portal:`, error.request); + throw new Error(`Failed to submit request: ${error.request}`); } else { - console.error(`ERROR: failed sending request:`, error); + throw new Error(`Failed to submit request: ${error}`); } }); } else {