Code Monkey home page Code Monkey logo

Comments (4)

allisson avatar allisson commented on August 24, 2024

Hi @ryandigital,

I need more context to reproduce this bug here:

  • python version
  • python-simple-rest-client version
  • the code that you try to execute

from python-simple-rest-client.

ryandigital avatar ryandigital commented on August 24, 2024

Python 3.6.4
python-simple-rest-client version the latest
and trying to get error message in a try catch manner

from python-simple-rest-client.

allisson avatar allisson commented on August 24, 2024

I can't reproduce this error here.

Here is my code:

# test.py file
from simple_rest_client.api import API
from simple_rest_client.exceptions import NotFoundError

httpbin_api = API(api_root_url='https://httpbin.org/')
httpbin_api.add_resource(resource_name='not_found_resource')

try:
    httpbin_api.not_found_resource.list()
except NotFoundError as exc:
    print('Not Found, error={!r}'.format(exc))
python test.py
Not Found, error=NotFoundError('operation=not_found_error, response=Response(url=\'https://httpbin.org/not_found_resource\', method=\'GET\', body=\'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\\n<title>404 Not Found</title>\\n<h1>Not Found</h1>\\n<p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>\\n\', headers={\'Connection\': \'keep-alive\', \'Server\': \'meinheld/0.6.1\', \'Date\': \'Fri, 16 Mar 2018 02:26:51 GMT\', \'Content-Type\': \'text/html\', \'Content-Length\': \'233\', \'Access-Control-Allow-Origin\': \'*\', \'Access-Control-Allow-Credentials\': \'true\', \'X-Powered-By\': \'Flask\', \'X-Processed-Time\': \'0\', \'Via\': \'1.1 vegur\'}, status_code=404, client_response=<Response [404]>)', Response(url='https://httpbin.org/not_found_resource', method='GET', body='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>404 Not Found</title>\n<h1>Not Found</h1>\n<p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>\n', headers={'Connection': 'keep-alive', 'Server': 'meinheld/0.6.1', 'Date': 'Fri, 16 Mar 2018 02:26:51 GMT', 'Content-Type': 'text/html', 'Content-Length': '233', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': 'true', 'X-Powered-By': 'Flask', 'X-Processed-Time': '0', 'Via': '1.1 vegur'}, status_code=404, client_response=<Response [404]>))

from python-simple-rest-client.

ryandigital avatar ryandigital commented on August 24, 2024

worked thanks a million

from python-simple-rest-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.