fix(http): error on non-200 status codes
BREAKING CHANGE: previously http would only error on network errors to match the fetch specification. Now status codes less than 200 and greater than 299 will cause Http's Observable to error. Closes #5130.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {isString} from 'angular2/src/facade/lang';
|
||||
import {RequestMethods} from './enums';
|
||||
import {makeTypeError} from 'angular2/src/facade/exceptions';
|
||||
import {Response} from './static_response';
|
||||
|
||||
export function normalizeMethodName(method): RequestMethods {
|
||||
if (isString(method)) {
|
||||
@@ -14,4 +15,6 @@ export function normalizeMethodName(method): RequestMethods {
|
||||
return method;
|
||||
}
|
||||
|
||||
export const isSuccess = (status: number): boolean => (status >= 200 && status < 300);
|
||||
|
||||
export {isJsObject} from 'angular2/src/facade/lang';
|
||||
|
||||
Reference in New Issue
Block a user