fix: catch rejected promise if it is in a try-catch block

This commit is contained in:
Hongbo Wu
2024-01-23 18:45:46 +08:00
parent 25603cf136
commit 8f5d4ae8a0
5 changed files with 6 additions and 6 deletions

View File

@ -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,
},

View File

@ -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

View File

@ -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',

View File

@ -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',

View File

@ -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',