Skip to content

Commit 037434b

Browse files
author
Manus AI
committed
debug: Add detailed logging to register command
Added debug logging to help diagnose network request issues: - Log the constructed API endpoint URL - Log the request data being sent - Log detailed error information including error codes - Log when no response is received from server This will help identify if: - The URL is being constructed correctly - The request is actually being made - There are network connectivity issues - The server is responding
1 parent 88f8564 commit 037434b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,8 @@ async function registerCommand(options) {
788788
};
789789

790790
console.log('\nRegistering account...');
791+
console.log(`API Endpoint: ${registrationApi}`);
792+
console.log(`Request Data:`, JSON.stringify(registrationData, null, 2));
791793

792794
// Make API call to register
793795
const response = await axios.post(registrationApi, registrationData);
@@ -802,6 +804,12 @@ async function registerCommand(options) {
802804
process.exit(1);
803805
}
804806
} catch (error) {
807+
console.error('\n[DEBUG] Error caught:', error.message);
808+
if (error.code) console.error('[DEBUG] Error code:', error.code);
809+
if (error.request && !error.response) {
810+
console.error('[DEBUG] No response received from server');
811+
console.error('[DEBUG] Request was made to:', registrationApi);
812+
}
805813
if (error.response && error.response.data) {
806814
const errorData = error.response.data;
807815
if (errorData.errors) {

0 commit comments

Comments
 (0)