This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check that the device is reconnected to the machine with: | |
`adb devices` | |
Reroute the connection to the development server with: | |
`adb reverse tcp:8081 tcp:8081` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import {notifier} from './util'; | |
// Fetch some missing information | |
axios.get('/api/articles/not-found').then(resp => { | |
// So something with article information | |
}).catch(error => { | |
const statusCode = error.response ? error.response.status : null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios, {AxiosError} from 'axios'; | |
import {notifier} from './util'; | |
interface ComposedError { | |
readonly message: string; | |
readonly error: AxiosError; | |
handleGlobally(): void; | |
getError(): AxiosError; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import {notifier} from './util'; | |
// errorComposer will compose a handleGlobally function | |
const errorComposer = (error) => { | |
return () => { | |
const statusCode = error.response ? error.response.status : null; | |
if (statusCode === 404) { | |
notifier.error('The requested resource does not exist or has been deleted') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import {notifier} from './util'; | |
axios.interceptors.response.use(undefined, function (error) { | |
const statusCode = error.response ? error.response.status : null; | |
if (statusCode === 404) { | |
notifier.error('The requested resource does not exist or has been deleted') | |
} |
OlderNewer