Skip to content

Commit 41031fc

Browse files
committed
source-shopify-native: update error message for insufficient permissions
1 parent a12c615 commit 41031fc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

source-shopify-native/source_shopify_native/graphql/bulk_job_manager.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
BulkSpecificJobResponse,
1010
BulkJobSubmitResponse,
1111
BulkOperationDetails,
12+
BulkOperationErrorCodes,
1213
BulkOperationStatuses,
1314
BulkOperationTypes,
1415
UserErrors,
@@ -194,7 +195,14 @@ async def execute(self, query: str) -> str | None:
194195
await asyncio.sleep(delay)
195196
delay = min(delay * 2, MAX_SLEEP)
196197
case BulkOperationStatuses.CANCELED | BulkOperationStatuses.CANCELING | BulkOperationStatuses.EXPIRED | BulkOperationStatuses.FAILED:
197-
raise BulkJobError(f"Unanticipated status {details.status} for job {job_id}. Error code: {details.errorCode}.")
198+
msg = f"Unanticipated status {details.status} for job {job_id}. Error code: {details.errorCode}."
199+
if details.errorCode and details.errorCode == BulkOperationErrorCodes.ACCESS_DENIED:
200+
msg = (
201+
f'Bulk job {job_id} has failed because the provided credentials do not have sufficient permissions.'
202+
f' If authenticating with an access token, ensure it is granted the permissions listed at'
203+
f' https://docs.estuary.dev/reference/Connectors/capture-connectors/shopify-native/#access-token-permissions.'
204+
)
205+
raise BulkJobError(msg)
198206
case _:
199207
raise BulkJobError(f"Unknown status {details.status} for job {job_id}.")
200208

0 commit comments

Comments
 (0)