github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/ui/app/utils/notify-forbidden.js (about) 1 // An error handler to provide to a promise catch to set a 2 // forbidden flag on the route 3 import codesForError from './codes-for-error'; 4 export default function notifyForbidden(route) { 5 return error => { 6 if (codesForError(error).includes('403')) { 7 route.set('isForbidden', true); 8 } else { 9 throw error; 10 } 11 }; 12 }