[Mono-bugs] [Bug 62112][Min] New - MonoIO.GetException usage can give unhelpful exception text
Thu, 29 Jul 2004 16:52:18 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by email@example.com.
--- shadow/62112 2004-07-29 16:52:18.000000000 -0400
+++ shadow/62112.tmp.4918 2004-07-29 16:52:18.000000000 -0400
@@ -0,0 +1,39 @@
+Product: Mono: Class Libraries
+Summary: MonoIO.GetException usage can give unhelpful exception text
+If System.IO.File.Copy or System.IO.File.Move return an exception through
+the MonoIO.GetException function, the error message isn't useful because no
+'path' parameter is given to the GetException call. With the
+soon-to-be-attached example program, you get:
+$ mcs copy-demo.cs
+$ mono copy-demo.exe
+Unhandled Exception: System.UnauthorizedAccessException: Access to the path
+"" is denied.
+in <0x00376> System.IO.File:Copy (string,string,bool)
+in <0x00016> Demo:Main (string)
+However, these functions have two path parameters, src and dest, and it's
+not possible to figure out which path is the one causing problems. (For
+instance, on access denied on file copy: is it because the source isn't
+readable or the dest isn't writable?)
+So it seems like MonoIO.CopyFile and .MoveFile would have to return some
+hint to the caller as to which path was responsible for the error condition.