feat(http): implement Response.prototype.toString() to make for a nicer error message

Added a toString method to the Response class displaying status / status and
the URL of the request.

Closes: https://github.com/angular/http/issues/89

Closes #7511
This commit is contained in:
Thierry Templier 2016-03-09 14:35:49 +01:00 committed by Misko Hevery
parent 1dcb663917
commit 89f61087c7
1 changed files with 4 additions and 0 deletions

View File

@ -114,4 +114,8 @@ export class Response {
arrayBuffer(): any {
throw new BaseException('"arrayBuffer()" method not implemented on Response superclass');
}
toString(): string {
return `Response with status: ${this.status} ${this.statusText} for URL: ${this.url}`;
}
}