From c06aa9208485608b0579ecb014dd42ce9003b096 Mon Sep 17 00:00:00 2001 From: Ankur Jain Date: Thu, 15 Aug 2024 11:22:55 -0700 Subject: [PATCH] Throw error instead of just printing. (#291) 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 {