github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/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 }