Skip to content

Commit

Permalink
better error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmundLeex committed Jan 21, 2017
1 parent eaee09b commit 2addc1b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/store/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@ class Store {
chrome.runtime.sendMessage({
type: DISPATCH_TYPE,
payload: data
}, ({error, value}) => {
}, (resp) => {
if (resp === undefined) {
throw(
"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;

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

0 comments on commit 2addc1b

Please sign in to comment.