import { SUCCESS_STATUS_CODE, ERROR_STATUS_CODE } from 'proactive-deps';
const checkDatabaseConnection = async () => {
// Perform the check (e.g., ping the database)
try {
await database.ping();
return SUCCESS_STATUS_CODE;
} catch (error) {
return {
code: ERROR_STATUS_CODE,
error: error,
errorMessage: 'Database not reachable',
};
}
};
The result of a dependency check. Can be either a number (status code) or an object containing error details.