File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -432,17 +432,25 @@ def click_button_fetch() -> None:
432432
433433 if messagebox .askquestion ("Fetch CRMScripts" , question ) == "yes" :
434434 fetch = Fetch (tenant )
435- fetch_success : bool = fetch .fetch ()
435+
436+ try :
437+ fetch_success : bool = fetch .fetch ()
438+
439+ if fetch .crmscript_version and fetch .crmscript_version < CURRENT_CRMSCRIPT_VERSION :
440+ messagebox .showinfo ("CRMScript version" ,
441+ "The fetcher CRMScript in use is not of the latest version.\n "
442+ "Updating the script is recommended." )
443+
444+ if fetch_success :
445+ messagebox .showinfo ("Success" , "Fetch successful!" )
446+ else :
447+ error_message = getattr (fetch , "last_error" , "Unknown error occurred." )
448+ messagebox .showerror ("Error" , f"Could not fetch data from tenant.\n \n Error: { error_message } " )
449+
450+ except Exception as e :
451+ messagebox .showerror ("Error" , f"An unexpected error occurred while fetching:\n { str (e )} " )
436452
437- if fetch .crmscript_version and fetch .crmscript_version < CURRENT_CRMSCRIPT_VERSION :
438- messagebox .showinfo ("CRMScript version" ,
439- "The fetcher CRMScript in use is not of the latest version.\n "
440- "Updating the script is recommended." )
441453
442- if fetch_success :
443- messagebox .showinfo ("Success" , "Fetch successful!" )
444- else :
445- messagebox .showerror ("Error" , "Could not fetch data from tenant." )
446454
447455 @staticmethod
448456 def click_button_open_file_explorer ():
You can’t perform that action at this time.
0 commit comments