Clearer error message

@gaurave

Small step towards improving the user experience from #2593.
Guess this was unused old code ?