Changing drive letters: "The parameter is incorrect"

This error that I came across today typifies what I hate about error messages that I see in various programs.

I was trying to change a drive letter in the system management console in Windows Server 2008 R2. I had upgraded my drive to a new drive and when I restarted my Windows Server VHD installation, it had reassigned all my drive letters. So I tried to set the Drive D drive letter to Drive L (back to the same drive letter it used to have). I had previously changed the Drive E to Drive G without an issue. But when I tried to make this change, the error message popped up saying “The parameter is incorrect”.

What exactly is a normal user supposed to make of that error message? Surely we developers can do better than this. (I’m using the collective “we” here to include the Microsoft Windows Server developers).

What was the real problem? It was that Windows had decided, to allocate a page file onto that drive. I had no idea it had done so. But because it was using the file, it wouldn’t let me change the drive letter for the drive that was holding the file. Changing the placement of the paging file followed by a reboot, then allowed me to change the drive letter back to what it used to be.

But surely, there’s some point in the code where the real problem is detected and surely “we” could surface a better error message than “The parameter is incorrect”.

This message reminded me of an error that was common in VB6 days where the system would say “insufficient memory”. I’ve lost track of the number of users that I’ve seen trying to add memory to machines to fix that problem. What the user was supposed to have instead interpreted from the message was “You have moved or removed a DLL that I was depending upon”. The person who wrote the error message has obviously decided that the only reason that we can’t load a DLL that used to be there is that we must have run out of memory. Surely “we” developers can do better than this. The next time that one of us feels the need to expose a message that says “The parameter is incorrect” or “Unexpected error” or “Catastrophic error”, etc. etc., please can we spend a few more cycles thinking about how to surface something more meaningful that would give the user some chance of understanding the issue?

2011-05-12