aboutsummaryrefslogtreecommitdiff
path: root/src/services/api/api.service.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-03-27 22:18:43 +0200
committerHenry Jameson <me@hjkos.com>2019-03-27 22:18:43 +0200
commitc2c7e12aadda0ca78f1b0e3789d19bdb6784d89f (patch)
tree420b470e2632d39fdb6cca48923fa6cffc65c036 /src/services/api/api.service.js
parentd766059deef65ea8c46616b340f6038476b47edf (diff)
review/remove error hiding
Diffstat (limited to 'src/services/api/api.service.js')
-rw-r--r--src/services/api/api.service.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 70aeb2a9..052a46dc 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -423,7 +423,7 @@ const favorite = ({ id, credentials }) => {
if (response.ok) {
return response.json()
} else {
- return {}
+ throw new Error('Error favoriting post')
}
})
.then((data) => parseStatus(data))
@@ -438,7 +438,7 @@ const unfavorite = ({ id, credentials }) => {
if (response.ok) {
return response.json()
} else {
- return {}
+ throw new Error('Error removing favorite')
}
})
.then((data) => parseStatus(data))
@@ -453,7 +453,7 @@ const retweet = ({ id, credentials }) => {
if (response.ok) {
return response.json()
} else {
- return {}
+ throw new Error('Error repeating post')
}
})
.then((data) => parseStatus(data))
@@ -468,7 +468,7 @@ const unretweet = ({ id, credentials }) => {
if (response.ok) {
return response.json()
} else {
- return {}
+ throw new Error('Error removing repeat')
}
})
.then((data) => parseStatus(data))