Skip to content
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

Notifer throws error in dev console if no message is supplied #10491

Closed
ycombinator opened this issue Feb 21, 2017 · 0 comments · Fixed by #41663
Closed

Notifer throws error in dev console if no message is supplied #10491

ycombinator opened this issue Feb 21, 2017 · 0 comments · Fixed by #41663
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@ycombinator
Copy link
Contributor

Steps to reproduce

Run this code:

import Notifier from 'ui/notify/notifier';

const notifier = new Notifier({ location: 'Some location' });
notifier.error();

Observed behavior

The developer console shows this error + stack trace:

TypeError: Cannot read property 'stack' of undefined
    at formatStack (notifier.js:248)
    at Notifier.error (notifier.js:421)
    at Notifier.wrapper [as error] (index.js:3095)
    at watch_list.js:71
    at processQueue (angular.js:14745)
    at angular.js:14761
    at Scope.$eval (angular.js:15989)
    at Scope.$digest (angular.js:15800)
    at angular.js:16028
    at completeOutstandingRequest (angular.js:5507)

Expected behavior

One of two approaches could be taken here:

  • Either the lack of argument to the notifier.error() method should be handled gracefully and the notifier shouldn't be displayed at all, or
  • The method should do a validity check and throw a meaningful Error. If uncaught, this would still result in bubbling up to the developer console but at least the message would be a bit more developer-friendly.
@ycombinator ycombinator added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:enhancement labels Feb 21, 2017
@timroes timroes mentioned this issue Jul 22, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants