Skip to content

response object is undefined when calling Parse.Cloud.httpRequest with nonsense url #703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuzeh opened this issue Feb 27, 2016 · 1 comment · Fixed by #773
Closed

response object is undefined when calling Parse.Cloud.httpRequest with nonsense url #703

yuzeh opened this issue Feb 27, 2016 · 1 comment · Fixed by #773
Assignees
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@yuzeh
Copy link
Contributor

yuzeh commented Feb 27, 2016

I'm getting an exception whenever I call Parse.Cloud.httpRequest with a nonsense URL. Ideally it should put something sensible in the error callback instead of crashing.

Environment Setup

parse-server v2.1.3

Steps to reproduce

          var promise = Parse.Cloud.httpRequest({
            method: "GET",
            url: "https://www.blah blahblah",
          });

Logs/Trace

TypeError: Cannot read property 'statusCode' of undefined
    at Request._callback (cloudcode/dist/node_modules/parse-server/lib/httpRequest.js:46:35)
    at self.callback (cloudcode/dist/node_modules/parse-server/node_modules/request/request.js:199:22)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
@gfosco gfosco added the type:bug Impaired feature or lacking behavior that is likely assumed label Feb 28, 2016
@flovilmart flovilmart self-assigned this Mar 1, 2016
@flovilmart
Copy link
Contributor

I'll check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants