Skip to content
Snippets Groups Projects
Commit a88fa7e3 authored by Ali Asaria's avatar Ali Asaria
Browse files

show error if install_conda fails

parent a1225a15
Branches
Tags
No related merge requests found
...@@ -68,7 +68,7 @@ ipcMain.handle('server:checkSystemRequirements', async (event) => { ...@@ -68,7 +68,7 @@ ipcMain.handle('server:checkSystemRequirements', async (event) => {
}); });
ipcMain.handle('server:checkIfInstalledLocally', async (event) => { ipcMain.handle('server:checkIfInstalledLocally', async (event) => {
return await checkLocalServerVersion() !== false; return (await checkLocalServerVersion()) !== false;
}); });
ipcMain.handle('server:checkLocalVersion', async (event) => { ipcMain.handle('server:checkLocalVersion', async (event) => {
...@@ -85,9 +85,10 @@ ipcMain.handle('server:InstallLocally', async (event) => { ...@@ -85,9 +85,10 @@ ipcMain.handle('server:InstallLocally', async (event) => {
ipcMain.handle('server:install_conda', async (event) => { ipcMain.handle('server:install_conda', async (event) => {
console.log('** Installing conda'); console.log('** Installing conda');
await executeInstallStep('install_conda'); const response = await executeInstallStep('install_conda');
console.log(response?.stdout);
console.log('Finishing installing conda'); console.log('Finishing installing conda');
return; return response;
}); });
ipcMain.handle('server:install_create-conda-environment', async (event) => { ipcMain.handle('server:install_create-conda-environment', async (event) => {
......
...@@ -439,7 +439,7 @@ function CheckForPlugins({ activeStep, setActiveStep }) { ...@@ -439,7 +439,7 @@ function CheckForPlugins({ activeStep, setActiveStep }) {
function CheckIfCondaInstalled({ activeStep, setActiveStep }) { function CheckIfCondaInstalled({ activeStep, setActiveStep }) {
const [installStatus, setInstallStatus] = useState(''); // notstarted, pending, success, error const [installStatus, setInstallStatus] = useState(''); // notstarted, pending, success, error
const [errorMessage, setErrorMessage] = useState(null);
useEffect(() => { useEffect(() => {
if (activeStep !== Steps.indexOf('CHECK_IF_CONDA_INSTALLED')) return; if (activeStep !== Steps.indexOf('CHECK_IF_CONDA_INSTALLED')) return;
...@@ -462,11 +462,13 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) { ...@@ -462,11 +462,13 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) {
{installStatus == 'success' && <Chip color="success">Success!</Chip>} {installStatus == 'success' && <Chip color="success">Success!</Chip>}
{installStatus == 'pending' && ( {installStatus == 'pending' && (
<> <>
<CircularProgress color="primary" /> Installing. This can take a <Typography level="body-sm" color="neutral">
while. <CircularProgress color="primary" />
<br />
Installing. This can take a while.
</Typography>
</> </>
)} )}
{activeStep == Steps.indexOf('CHECK_IF_CONDA_INSTALLED') && {activeStep == Steps.indexOf('CHECK_IF_CONDA_INSTALLED') &&
installStatus == 'notstarted' && ( installStatus == 'notstarted' && (
<ButtonGroup variant="plain" spacing={1}> <ButtonGroup variant="plain" spacing={1}>
...@@ -479,6 +481,10 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) { ...@@ -479,6 +481,10 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) {
const installConda = await window.electron.ipcRenderer.invoke( const installConda = await window.electron.ipcRenderer.invoke(
'server:install_conda' 'server:install_conda'
); );
if (installConda?.error) {
setInstallStatus('error');
setErrorMessage(installConda?.stderr);
}
const condaExists = await window.electron.ipcRenderer.invoke( const condaExists = await window.electron.ipcRenderer.invoke(
'server:checkIfCondaExists' 'server:checkIfCondaExists'
); );
...@@ -504,7 +510,9 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) { ...@@ -504,7 +510,9 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) {
} }
return false; return false;
}, },
() => {}, () => {
setInstallStatus('error');
},
2000, 2000,
8 8
); );
...@@ -514,6 +522,15 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) { ...@@ -514,6 +522,15 @@ function CheckIfCondaInstalled({ activeStep, setActiveStep }) {
</Button> </Button>
</ButtonGroup> </ButtonGroup>
)} )}
<Typography level="body-sm" color="warning">
{errorMessage && (
<>
Transformer Lab encountered the following unexpected Error:
<pre style={{ whiteSpace: 'pre-wrap' }}>{errorMessage}</pre>
Please try to fix the above issue and restart the app.
</>
)}
</Typography>
</Stack> </Stack>
</> </>
); );
...@@ -641,10 +658,7 @@ function CheckDependencies({ activeStep, setActiveStep }) { ...@@ -641,10 +658,7 @@ function CheckDependencies({ activeStep, setActiveStep }) {
'server:checkDependencies' 'server:checkDependencies'
); );
if ( if (ipcResponse?.status == 'success' && ipcResponse?.data?.length == 0) {
ipcResponse?.status == 'success' &&
ipcResponse?.data?.length == 0
) {
setInstallStatus('success'); setInstallStatus('success');
setActiveStep( setActiveStep(
Steps.indexOf('CHECK_IF_PYTHON_DEPENDENCIES_INSTALLED') + 1 Steps.indexOf('CHECK_IF_PYTHON_DEPENDENCIES_INSTALLED') + 1
...@@ -691,10 +705,9 @@ function CheckDependencies({ activeStep, setActiveStep }) { ...@@ -691,10 +705,9 @@ function CheckDependencies({ activeStep, setActiveStep }) {
'server:install_install-dependencies' 'server:install_install-dependencies'
); );
const ipcResponse = const ipcResponse = await window.electron.ipcRenderer.invoke(
await window.electron.ipcRenderer.invoke( 'server:checkDependencies'
'server:checkDependencies' );
);
if ( if (
ipcResponse?.status == 'success' && ipcResponse?.status == 'success' &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment