Untitled

Anonymous
plain_text
10/18/2024 9:29 PM
580 B
18
Indexable
    async getConnection() {
        // ... existing code ...
        } catch (error) {
            console.error(`Error connecting to the database at host ${host}: ${error.message}`); // Log the error message
            console.error(`Full error details: ${JSON.stringify(error)}`); // Log full error details
            throw new Error('Database connection failed'); // Throw a new error to be handled by the caller
        }
    }
Editor is loading...
Leave a Comment