[platform-server] vague error when entire URL is not provided for Http · Issue #15349 · angular/angular · GitHub
Skip to content

[platform-server] vague error when entire URL is not provided for Http #15349

Description

@MarkPieszak

I'm submitting a ... (check one with "x")

[x] bug report
[x] (or) feature request

Current behavior
When calling a rest local rest API for example /api/getproducts, the server Http throws a vague error

ERROR { Error: Uncaught (in promise): Error at resolvePromise

Providing the entire URL fixes it: (but user would never know to do this)

this.http.get('http://localhost:5000/API/test') 

Expected behavior

Previously (angular2-universal) we set the origin-URL for the user in these situations, so if we don't want to add that same behavior,
we need to make sure to Throw a more specific error letting the Dev know why the server didn't render that Http response. (Note the rest of the app actually renders it doesn't break rendering).

Also Docs should reflect whatever we decide to do here as well, to prevent confusion.

Minimal reproduction of the problem with instructions

this.http.get('/API/test') 

What is the motivation / use case for changing the behavior?
Previous Users of Universal might be confused why his existing functionality doesn't work anymore, especially if not given a good Error message explaining it.

  • Angular version: 4.0.0.rc5 (or nightly build)

CC/ @vikerman @alxhub @gdi2290

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions