Skip to content

Commit 46e009b

Browse files
jrjohnsonknownasilya
authored andcommitted
fix: Log exceptions instead of throwing them (#50)
When there is a network or other issue fetching the VERSION file we should just log it. This prevents ugly user messages or busy logging when users machines go to sleep and stop network traffic.
1 parent a680ac2 commit 46e009b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

addon/components/new-version-notifier/component.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*eslint no-console: ["error", { allow: ["log"] }] */
12
import { getOwner } from '@ember/application';
23
import Component from '@ember/component';
34
import { get, computed } from '@ember/object';
@@ -78,8 +79,10 @@ export default Component.extend({
7879

7980
this.set('version', newVersion);
8081
});
81-
} catch (e){
82-
if (!Ember.testing) { throw e; }
82+
} catch (e) {
83+
if (!Ember.testing) {
84+
console.log(e);
85+
}
8386
} finally {
8487
let updateInterval = this.get('updateIntervalWithTesting');
8588
if (updateInterval === null || updateInterval === undefined) { updateInterval = ONE_MINUTE }

0 commit comments

Comments
 (0)