Suppress log, move constant to shared

pull/975/head
Jared Scheib 2017-03-06 22:12:51 -08:00
parent 63ea4d1b8b
commit 05da325d7c
2 changed files with 5 additions and 3 deletions

View File

@ -472,3 +472,5 @@ export const PRESENTATION_MODE_ANIMATION_DELAY = 0 // In milliseconds.
export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds.
export const ADMIN_NOTIFICATION_DELAY = 1500 // milliseconds
export const RES_UNAUTHORIZED = 401

View File

@ -2,7 +2,7 @@ import axios from 'axios';
let links
const UNAUTHORIZED = 401
import {RES_UNAUTHORIZED} from 'shared/constants'
export default async function AJAX({
url,
@ -47,10 +47,10 @@ export default async function AJAX({
}
} catch (error) {
const {response} = error
if (!response.status === UNAUTHORIZED) {
if (!response.status === RES_UNAUTHORIZED) {
console.error(error) // eslint-disable-line no-console
}
console.error(error) // eslint-disable-line no-console
// console.error(error) // eslint-disable-line no-console
const {auth} = links
throw {auth, ...response} // eslint-disable-line no-throw-literal
}