diff --git a/src/utils/processTrigger.ts b/src/utils/processTrigger.ts index b9f2e722..59f294b3 100644 --- a/src/utils/processTrigger.ts +++ b/src/utils/processTrigger.ts @@ -54,8 +54,9 @@ export function processTrigger( const channel = new MessageChannel(); channel.port1.onmessage = ({ data: responseData }) => { channel.port1.close(); - if (responseData.error) { - rej(responseData.error); + const error = responseData.error || responseData?.data?.error; + if (error) { + rej(error); } else { res(responseData); }