The following line works fine
SPList list = web.Lists["docLibName"];
The following line raises exception "value does not fall within the expected range"
SPFolder = web.Folders["docLibName"];
You can't get the folder of your list with only this name. you must pass the server relative URL.
To get the folder (rootfolder) of your list you can try :
SPList list = web.Lists["docLibName"];
SPFolder listFolder = list.RootFolder;
Here,
SPList
is SharePoint Object of List
types.
So this will worked for you
SPList list = web.Lists["docLibName"];
For getting folder you should use
SPFolder folder = list.GetFolder("Folder Name");
Let me know if you need some more assists.