From 6522260fdd8950bc67ae8eb6b31cbcda90b2154f Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:42:45 +0100 Subject: [PATCH] chore(objectloader): add details to error for fetch (#5031) --- packages/objectloader/src/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/objectloader/src/index.js b/packages/objectloader/src/index.js index 74f9f00df..5f5567473 100644 --- a/packages/objectloader/src/index.js +++ b/packages/objectloader/src/index.js @@ -614,10 +614,16 @@ class ObjectLoader { const response = await this.fetch(this.requestUrlRootObj, { headers: this.headers }) if (!response.ok) { if ([401, 403].includes(response.status)) { - throw new ObjectLoaderRuntimeError('You do not have access to the root object!') + throw new ObjectLoaderRuntimeError( + `You do not have access to the root object! Object URI: '${ + this.requestUrlRootObj + }', Token ID: '${this.token.substring(0, 10)}'. Response: '${ + response.status + } ${response.statusText}'` + ) } throw new ObjectLoaderRuntimeError( - `Failed to fetch root object: ${response.status} ${response.statusText})` + `Failed to fetch root object. Object URI: '${this.requestUrlRootObj}'. Response: '${response.status} ${response.statusText}'` ) } const responseText = await response.text()