github.com/hspak/nomad@v0.7.2-0.20180309000617-bc4ae22a39a5/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 }