]> gitweb.factorcode.org Git - factor.git/commitdiff
windows.errors: make check-invalid-handle throw windows-error instances
authorAlexander Iljin <ajsoft@yandex.ru>
Tue, 24 May 2016 17:30:02 +0000 (20:30 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2020 21:18:33 +0000 (13:18 -0800)
There are two consequences:
- the thrown object is now a windows-error, previously it was a string;
- if GetLastError returns zero, nothing is thrown. Previously the string
"The operation completed successfully." was thrown in that case.

basis/windows/errors/errors.factor

index 83a8df0148f663173bbd8731f828fba2b30a7eb2..82e8701d16f0fe231dd7ba319f4d99f79a938e88 100644 (file)
@@ -744,7 +744,7 @@ ERROR: windows-error n string ;
     win32-error-string throw ;
 
 : check-invalid-handle ( handle -- handle )
-    dup INVALID_HANDLE_VALUE = [ throw-win32-error ] when ;
+    dup INVALID_HANDLE_VALUE = [ win32-error ] when ;
 
 CONSTANT: expected-io-errors
     ${