Skip to content

Commit

Permalink
Merge pull request #120 from cunei/wip-fix-3871
Browse files Browse the repository at this point in the history
Convert ERROR_PATH_NOT_FOUND to FileNotFoundException in WinMilli
  • Loading branch information
cunei authored Jan 12, 2018
2 parents c63d2a0 + e23e42a commit 1dbb37f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion io/src/main/scala/sbt/internal/io/Milli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.sun.jna.platform.win32.WinNT.HANDLE
import com.sun.jna.platform.win32.WinBase.INVALID_HANDLE_VALUE
import com.sun.jna.platform.win32.WinBase.FILETIME
import com.sun.jna.platform.win32.WinError.ERROR_FILE_NOT_FOUND
import com.sun.jna.platform.win32.WinError.ERROR_PATH_NOT_FOUND

import sbt.internal.io.MacJNA._

Expand Down Expand Up @@ -269,7 +270,7 @@ private object WinMilli extends MilliNative[FILETIME] {
null)
if (hFile == INVALID_HANDLE_VALUE) {
val err = GetLastError()
if (err == ERROR_FILE_NOT_FOUND)
if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)
throw new FileNotFoundException("Not found: " + lpFileName)
else
throw new IOException("CreateFile() failed with error " + GetLastError())
Expand Down

0 comments on commit 1dbb37f

Please sign in to comment.