Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
fix #38: http error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nailgun committed Aug 6, 2020
1 parent 83d33de commit 720deb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export class NotiErrorApi {
constructor(apiResponse, netResponse) {

// api response is an object
if (typeof apiResponse === 'object') {
if (typeof apiResponse === 'object' && apiResponse.kind === 'Status') {
const { code, reason, message } = apiResponse;
this.code = code;
this.message = `${code} ${reason}`;
Expand All @@ -29,7 +29,7 @@ export class NotiErrorApi {
export default store => next => action => {
const { payload: { error } = {}} = action;
if (error) {

// NotiErrorApi
if (error instanceof NotiErrorApi) {
const { silent, description } = error;
Expand Down

0 comments on commit 720deb8

Please sign in to comment.