github / GitPad

Notepad.exe as Git commit editor
MIT License
187 stars 69 forks source link

GitPad crashes when you give it a bad arg #6

Closed half-ogre closed 12 years ago

half-ogre commented 12 years ago

For instance, try running gitpad.exe --help. It crashes. We should handle this more gracefully.

wkschwartz commented 12 years ago

For what it's worth, below is a traceback from running gitpad --help on MINGW in Windows 7. MINGW hung during this until Windows killed GitPad.

$ gitpad --help
System.IO.FileNotFoundException: Could not find file 'g:\repo\src\--help'.

File name: 'g:\customerdb\src\--help'
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean
bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detec
tEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path, Encoding encoding)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding)
   at Gitpad.Program.Main(String[] args)

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: path
   at System.IO.File.Delete(String path)
   at Gitpad.Program.Main(String[] args)
Signal 67