[MLton-commit] r5186

Vesa Karvonen vesak at mlton.org
Tue Feb 13 08:40:11 PST 2007


Changed to raise SysError instead of a custom exception.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml
U   mltonlib/trunk/com/ssh/windows/unstable/public/windows.sig

----------------------------------------------------------------------

Modified: mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml
===================================================================
--- mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml	2007-02-13 16:11:51 UTC (rev 5185)
+++ mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml	2007-02-13 16:40:11 UTC (rev 5186)
@@ -6,8 +6,6 @@
 
 (* Implementation of Windows utilities. *)
 structure Windows :> WINDOWS = struct
-   exception Error of {function : String.t, error : Word32.t}
-
    val op >>& = With.>>&
 
    local
@@ -18,22 +16,16 @@
       val errorMoreData    = `G_win_ERROR_MORE_DATA.obj'
    end
 
-   fun errorToString error =
-       With.around (fn () => F_win_FormatErrorLocalAlloc.f' error)
-                   (ignore o F_win_LocalFree.f' o C.Ptr.inject')
-                   ZString.toML'
-
-   val () =
-       Exn.addMessager
-          (fn Error {function, error} =>
-              SOME (concat ["Win.Error: ", function, " failed: ",
-                            errorToString error])
-            | _ => NONE)
-
    val getLastError = F_win_GetLastError.f
 
    fun raiseError function error =
-       raise Error {function = function, error = error}
+       raise OS.SysErr
+                (concat
+                    [function, ": ",
+                     With.around (fn () => F_win_FormatErrorLocalAlloc.f' error)
+                                 (ignore o F_win_LocalFree.f' o C.Ptr.inject')
+                                 ZString.toML'],
+                 NONE)
 
    fun raiseOnError function error = let
       val error = Word.fromInt error

Modified: mltonlib/trunk/com/ssh/windows/unstable/public/windows.sig
===================================================================
--- mltonlib/trunk/com/ssh/windows/unstable/public/windows.sig	2007-02-13 16:11:51 UTC (rev 5185)
+++ mltonlib/trunk/com/ssh/windows/unstable/public/windows.sig	2007-02-13 16:40:11 UTC (rev 5186)
@@ -12,8 +12,6 @@
  *   http://mlton.org/basis/windows.html .
  *)
 signature WINDOWS = sig
-   exception Error of {function : String.t, error : Word32.t}
-
    structure Key : sig
       include BIT_FLAGS
 




More information about the MLton-commit mailing list