Skip to content

Commit 17c4ba2

Browse files
authored
Start on #480
Add additional logging
1 parent 73158bd commit 17c4ba2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Includes/_URLModifications.au3

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <Array.au3>
44

55
#include "Base64.au3"
6+
#include "_Logging.au3"
67
#include "_Settings.au3"
78

89
Func _ChangeBingWS($sURL)
@@ -488,13 +489,19 @@ Func _WinAPI_UrlUnescape($sUrl, $dFlags = 0x00040000)
488489
"dword*", 1024, _ ; DWORD *pcchUnescaped - The number of characters in the buffer pointed to by pszUnescaped
489490
"dword", $dFlags) ; DWORD dwFlags
490491
If @error Then
491-
; ConsoleWrite('UrlUnescape error: ' & @error & ', LastErr: ' & _WinAPI_GetLastError() & ', LastMsg: ' & _WinAPI_GetLastErrorMessage() & @CRLF)
492-
Return SetError(@error, @extended, 0)
492+
FileWrite($hLogs[$URIFailures], _NowCalc() & " - " & "UrlUnescapeW call failed with error: (" & @error & "," & @extended & ")" & @CRLF)
493+
Return $sURL
493494
EndIf
494495

495496
If IsArray($aUrlUnescape) Then
496-
If $aUrlUnescape[2] <> "decodedUrl" Then Return $aUrlUnescape[2]
497-
Return $sURL
497+
If $aUrlUnescape[2] <> "decodedUrl" Then ; Decode Successful
498+
Return $aUrlUnescape[2]
499+
Else
500+
FileWrite($hLogs[$URIFailures], _NowCalc() & " - " & "UrlUnescapeW failed. Attempt result: " & _ArrayToString($aUrlUnescape) & @CRLF)
501+
EndIf
502+
Else
503+
FileWrite($hLogs[$URIFailures], _NowCalc() & " - " & "How did we get here? UrlUnescapeW is " & $aUrlUnescape & @CRLF)
498504
EndIf
505+
Return $sURL
499506

500507
EndFunc ;==>_WinAPI_UrlUnescape

0 commit comments

Comments
 (0)