aboutsummaryrefslogtreecommitdiff
path: root/src/services/api/api.service.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/api/api.service.js')
-rw-r--r--src/services/api/api.service.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 62d35d33..2b1ef5df 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -276,26 +276,26 @@ const fetchFollowRequests = ({credentials}) => {
const fetchConversation = ({id, credentials}) => {
let url = `${CONVERSATION_URL}/${id}.json?count=100`
return fetch(url, { headers: authHeaders(credentials) })
- .then((data) => data.json())
.then((data) => {
if (data.ok) {
return data
}
- throw new Error('Error fetching timeline')
+ throw new Error('Error fetching timeline', data)
})
+ .then((data) => data.json())
.then((data) => data.map(parseStatus))
}
const fetchStatus = ({id, credentials}) => {
let url = `${STATUS_URL}/${id}.json`
return fetch(url, { headers: authHeaders(credentials) })
- .then((data) => data.json())
.then((data) => {
if (data.ok) {
return data
}
- throw new Error('Error fetching timeline')
+ throw new Error('Error fetching timeline', data)
})
+ .then((data) => data.json())
.then((data) => parseStatus(data))
}
@@ -355,7 +355,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
if (data.ok) {
return data
}
- throw new Error('Error fetching timeline')
+ throw new Error('Error fetching timeline', data)
})
.then((data) => data.json())
.then((data) => data.map(isNotifications ? parseNotification : parseStatus))