a bit of error handling

replacing #122 with a cleaner version, thanks to @maxcountryman

Having a real exception when sometimes goes wrong saved me some time when working against a slightly weird oauth2 provider.