From 981051a9e8cf811dfc6c61027563785a067cc568 Mon Sep 17 00:00:00 2001 From: yuriy Date: Mon, 18 Dec 2023 23:36:06 -0500 Subject: [PATCH] re-enabled logging to text file, updated+fixed URLdownloadtovar error message --- General-Functions.ahk | 3 +-- URLDownloadToVar.ahk | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/General-Functions.ahk b/General-Functions.ahk index d008589..816b92c 100644 --- a/General-Functions.ahk +++ b/General-Functions.ahk @@ -35,10 +35,9 @@ SaveOrPostProgress(Message:="",PostType:=""){ if(InStr(PostType, "Tooltip")){ TooltipThis(Message) } -/* if(InStr(PostType, "ErrorLoggingTextFile")){ + if(InStr(PostType, "ErrorLoggingTextFile")){ Func_LogErrorsToTextFile(Message) } -*/ if(InStr(PostType, "ErrorSummaryVar")){ Func_LogErrorsToVar(Message) } diff --git a/URLDownloadToVar.ahk b/URLDownloadToVar.ahk index 1e93648..60fa873 100644 --- a/URLDownloadToVar.ahk +++ b/URLDownloadToVar.ahk @@ -1,11 +1,14 @@ URLDownloadToVar(url){ + hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1") hObject.Open("GET",url) - try hObject.Send() + try { + hObject.Send() + } catch e { + MsgBox, 4096, Error, Failed to connect to:`n`n%url%`n`nAre you connected to the internet? Or is the website down?`n`nDisable Auto Update Check to disable this message. return "" - ; msgbox, failed! } return hObject.ResponseText