[Mono-bugs] [Bug 62112][Min] New - MonoIO.GetException usage can give unhelpful exception text
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
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 peter@newton.cx.
http://bugzilla.ximian.com/show_bug.cgi?id=62112
--- 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 @@
+Bug#: 62112
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: peter@newton.cx
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+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
+Compilation succeeded
+$ 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.