Skip to content

Commit

Permalink
fix(react): Do not suppress unhandled rejections in promises. (#4155)
Browse files Browse the repository at this point in the history
When react components chain off promises (angular $q promises) for callbacks (`setState()`, etc), any thrown errors would be swallowed by $qProvider.errorOnUnhandledRejections(true)

This change will cause more noise in the console, but I think this is a necessary change.  When other kinds of rejections occur and spam the console, we should address these cases individually.
  • Loading branch information
christopherthielen authored and anotherchrisberry committed Sep 27, 2017
1 parent ed188b0 commit 64d385f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions app/scripts/modules/core/src/bootstrap/angular.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ bootstrapModule.config(($httpProvider: IHttpProvider) => {
};
});

// Angular 1.6 stops suppressing unhandle rejections on promises. This resets it back to 1.5 behavior.
// See https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$q
bootstrapModule.config(($qProvider: IQProvider) => {
'ngInject';
$qProvider.errorOnUnhandledRejections(false);
});

// Angular 1.6 defaults preAssignBindingsEnabled to false, reset to true to mimic 1.5 behavior.
// See https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
bootstrapModule.config(($compileProvider: ICompileProvider) => {
Expand Down

0 comments on commit 64d385f

Please sign in to comment.