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',
|
||||
timeout: REQUEST_TIMEOUT,
|
||||
})
|
||||
return axios.put(uploadSignedUrl, stream.data, {
|
||||
return await axios.put(uploadSignedUrl, stream.data, {
|
||||
headers: {
|
||||
'Content-Type': contentType,
|
||||
},
|
||||
|
||||
@ -112,7 +112,7 @@ const createHttpTaskWithToken = async ({
|
||||
}
|
||||
|
||||
try {
|
||||
return client.createTask({ parent, task })
|
||||
return await client.createTask({ parent, task })
|
||||
} catch (error) {
|
||||
logError(error)
|
||||
return null
|
||||
|
||||
@ -30,7 +30,7 @@ export const setLabels = async (
|
||||
})
|
||||
|
||||
try {
|
||||
return axios.post(`${apiEndpoint}/graphql`, data, {
|
||||
return await axios.post(`${apiEndpoint}/graphql`, data, {
|
||||
headers: {
|
||||
Cookie: `auth=${auth};`,
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@ -29,7 +29,7 @@ export const sendNotification = async (
|
||||
}
|
||||
|
||||
try {
|
||||
return axios.post(`${apiEndpoint}/notification/send`, requestData, {
|
||||
return await axios.post(`${apiEndpoint}/notification/send`, requestData, {
|
||||
headers: {
|
||||
Cookie: `auth=${auth};`,
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@ -27,7 +27,7 @@ export const archivePage = async (
|
||||
})
|
||||
|
||||
try {
|
||||
return axios.post(`${apiEndpoint}/graphql`, data, {
|
||||
return await axios.post(`${apiEndpoint}/graphql`, data, {
|
||||
headers: {
|
||||
Cookie: `auth=${auth};`,
|
||||
'Content-Type': 'application/json',
|
||||
@ -66,7 +66,7 @@ export const markPageAsRead = async (
|
||||
})
|
||||
|
||||
try {
|
||||
return axios.post(`${apiEndpoint}/graphql`, data, {
|
||||
return await axios.post(`${apiEndpoint}/graphql`, data, {
|
||||
headers: {
|
||||
Cookie: `auth=${auth};`,
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user