Skip to content

Commit 81c8ce6

Browse files
author
woi
committed
use fake error response
1 parent 7bbb358 commit 81c8ce6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

App/Services/UserService.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ const userApiClient = create({
2121

2222
function fetchUser() {
2323
// Simulate an error 50% of the time just for testing purposes
24-
// if (Math.random() > 0.5) {
25-
// return new Promise(function(resolve, reject) {
26-
// resolve(null)
27-
// })
28-
// }
24+
if (Math.random() > 0.5) {
25+
return new Promise(function(resolve, reject) {
26+
resolve(null)
27+
})
28+
}
29+
2930
let number = Math.floor(Math.random() / 0.1) + 1
3031

3132
return userApiClient.get(number.toString()).then((response) => {

0 commit comments

Comments
 (0)