Skip to content

Commit 64448dd

Browse files
authored
Treat warnings as errors for release builds (#17)
1 parent 0b2b9d4 commit 64448dd

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

DokanPbo.Core/DokanPbo.Core.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<DefineConstants>TRACE</DefineConstants>
3030
<ErrorReport>prompt</ErrorReport>
3131
<WarningLevel>4</WarningLevel>
32+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3233
</PropertyGroup>
3334
<ItemGroup>
3435
<Reference Include="DokanNet, Version=1.1.2.1, Culture=neutral, PublicKeyToken=cef3dedf553bda55">

DokanPbo.Core/PboFS.cs

+4
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,17 @@ public NtStatus DeleteDirectory(string filename, DokanFileInfo info)
291291
}
292292
catch (AccessViolationException e)
293293
{
294+
Console.WriteLine("DokanPBO::DeleteDirectory failed due to AccessViolationException: " + e);
294295
return DokanResult.AccessDenied;
295296
}
296297
catch (IOException e)
297298
{
299+
Console.WriteLine("DokanPBO::DeleteDirectory failed due to IOException: " + e);
298300
return DokanResult.SharingViolation;
299301
}
300302
catch (Exception e)
301303
{
304+
Console.WriteLine("DokanPBO::DeleteDirectory failed due to exception: " + e);
302305
return DokanResult.NotImplemented;
303306
}
304307

@@ -322,6 +325,7 @@ public NtStatus DeleteFile(string filename, DokanFileInfo info)
322325
}
323326
catch (DirectoryNotFoundException e)
324327
{
328+
Console.WriteLine("DokanPBO::DeleteFile failed due to DirectoryNotFoundException: " + e);
325329
//File is already gone. Just return success
326330
}
327331

DokanPbo.Core/PboFSNode.cs

+3
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ public override NtStatus ReadFile(byte[] buffer, out int readBytes, long offset)
389389
catch (FileNotFoundException e)
390390
{
391391
readBytes = 0;
392+
Console.WriteLine("DokanPBO::ReadFile failed due to FileNotFoundException: " + e);
392393
return DokanResult.FileNotFound;
393394
}
394395
}
@@ -416,6 +417,7 @@ public NtStatus WriteFile(byte[] buffer, out int writtenBytes, long offset)
416417
catch (FileNotFoundException e)
417418
{
418419
writtenBytes = 0;
420+
Console.WriteLine("DokanPBO::WriteFile failed due to FileNotFoundException: " + e);
419421
return DokanResult.FileNotFound;
420422
} //#TODO access denied exception
421423
}
@@ -437,6 +439,7 @@ public NtStatus SetEof(long length)
437439
}
438440
catch (FileNotFoundException e)
439441
{
442+
Console.WriteLine("DokanPBO::SetEof failed due to FileNotFoundException: " + e);
440443
return DokanResult.FileNotFound;
441444
} //#TODO access denied
442445
}

DokanPbo/DokanPbo.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<DefineConstants>TRACE</DefineConstants>
3535
<ErrorReport>prompt</ErrorReport>
3636
<WarningLevel>4</WarningLevel>
37+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3738
</PropertyGroup>
3839
<ItemGroup>
3940
<Reference Include="CommandLine, Version=1.9.71.2, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">

0 commit comments

Comments
 (0)