Make accept() throw more useful errors
Merge pull request #7822 from JuliaLang/sf/accepterrors

Make accept() throw more useful errors