ClinicianFOCUS / clinicianfocus-installer

Install tool to help with installing the software and tools under development in this applied research project.
GNU Affero General Public License v3.0
0 stars 1 forks source link

Overall, add more error handling #13

Open yingbull opened 1 month ago

yingbull commented 1 month ago
          **suggestion:** Add error handling for ExecWait and Exec commands

The current implementation doesn't check if the ExecWait and Exec commands succeed. Consider adding error checking and informing the user if these commands fail, possibly providing troubleshooting steps.

Function FinishPageLeave
    ${NSD_GetState} $Checkbox_LLM $0
    ${If} $0 == ${BST_CHECKED}
        ExecWait 'docker-compose -f "$INSTDIR\local-llm-container\docker-compose.yml" up -d --build' $1
        ${If} $1 != 0
            MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to launch Local LLM. Please check your Docker installation."
        ${EndIf}
    ${EndIf}

    ${NSD_GetState} $Checkbox_Speech2Text $0
    ${If} $0 == ${BST_CHECKED}
        ExecWait 'docker-compose -f "$INSTDIR\speech2text-container\docker-compose.yml" up -d --build' $1
        ${If} $1 != 0
            MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to launch Speech2Text. Please check your Docker installation."
        ${EndIf}
    ${EndIf}

    ${NSD_GetState} $Checkbox_FreeScribe $0
    ${If} $0 == ${BST_CHECKED}
        Exec '"$APPDATA\freescribe\freescribe-client.exe"'
    ${EndIf}
FunctionEnd

_Originally posted by @sourcery-ai[bot] in https://github.com/ClinicianFOCUS/clinicianfocus-installer/pull/4#discussion_r1797211807_