requests: Don't assume that error is an array.
It may be a string, and using [0] truncates to just the first character.