better raise_error method - thanks @cyli

Earlier method would failure if called with any other error. Moreoever,
it seemed dirty to access deeply nested attributes without any check.
Now, it expects APIError and raises RequestError if code doesnt match