fix: catch rejected promise if it is in a try-catch block
This commit is contained in:
@ -95,7 +95,7 @@ const uploadToSignedUrl = async (
|
|||||||
responseType: 'stream',
|
responseType: 'stream',
|
||||||
timeout: REQUEST_TIMEOUT,
|
timeout: REQUEST_TIMEOUT,
|
||||||
})
|
})
|
||||||
return axios.put(uploadSignedUrl, stream.data, {
|
return await axios.put(uploadSignedUrl, stream.data, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': contentType,
|
'Content-Type': contentType,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -112,7 +112,7 @@ const createHttpTaskWithToken = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return client.createTask({ parent, task })
|
return await client.createTask({ parent, task })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logError(error)
|
logError(error)
|
||||||
return null
|
return null
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export const setLabels = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return axios.post(`${apiEndpoint}/graphql`, data, {
|
return await axios.post(`${apiEndpoint}/graphql`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
Cookie: `auth=${auth};`,
|
Cookie: `auth=${auth};`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export const sendNotification = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return axios.post(`${apiEndpoint}/notification/send`, requestData, {
|
return await axios.post(`${apiEndpoint}/notification/send`, requestData, {
|
||||||
headers: {
|
headers: {
|
||||||
Cookie: `auth=${auth};`,
|
Cookie: `auth=${auth};`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export const archivePage = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return axios.post(`${apiEndpoint}/graphql`, data, {
|
return await axios.post(`${apiEndpoint}/graphql`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
Cookie: `auth=${auth};`,
|
Cookie: `auth=${auth};`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -66,7 +66,7 @@ export const markPageAsRead = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return axios.post(`${apiEndpoint}/graphql`, data, {
|
return await axios.post(`${apiEndpoint}/graphql`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
Cookie: `auth=${auth};`,
|
Cookie: `auth=${auth};`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
Reference in New Issue
Block a user