Skip to content

Commit

Permalink
- use typeof\n- throw error object\n- simplified syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmundLeex committed Jan 21, 2017
1 parent 2addc1b commit ab5b48d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/store/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ class Store {
type: DISPATCH_TYPE,
payload: data
}, (resp) => {
if (resp === undefined) {
throw(
if (typeof resp === 'undefined') {
throw new Error(
"Looks like there is an error in the background page. " +
"You might want to inspect your background page for more details."
);
}

let error = resp.error;
let value = resp.value;
const {error, value} = resp;

if (error) {
reject(assignIn((new Error()), error));
Expand Down

0 comments on commit ab5b48d

Please sign in to comment.