Skip to content

Commit 9b48055

Browse files
brianorwhateverdavidlehn
authored andcommitted
Added URL to context resolution error message.
1 parent 5367858 commit 9b48055

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# jsonld ChangeLog
22

3+
## 8.3.3 - xxxx-xx-xx
4+
5+
### Added
6+
- Added URL to context resolution error message.
7+
38
## 8.3.2 - 2023-12-06
49

510
### Fixed

lib/ContextResolver.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ module.exports = class ContextResolver {
171171
}
172172
} catch(e) {
173173
throw new JsonLdError(
174-
'Dereferencing a URL did not result in a valid JSON-LD object. ' +
175-
'Possible causes are an inaccessible URL perhaps due to ' +
174+
'Dereferencing the URL ' + url + ' did not result in a valid JSON-LD ' +
175+
'object. Possible causes are an inaccessible URL perhaps due to ' +
176176
'a same-origin policy (ensure the server uses CORS if you are ' +
177177
'using client-side JavaScript), too many redirects, a ' +
178178
'non-JSON response, or more than one HTTP Link Header was ' +
@@ -184,8 +184,8 @@ module.exports = class ContextResolver {
184184
// ensure ctx is an object
185185
if(!_isObject(context)) {
186186
throw new JsonLdError(
187-
'Dereferencing a URL did not result in a JSON object. The ' +
188-
'response was valid JSON, but it was not a JSON object.',
187+
'Dereferencing the URL ' + url + ' did not result in a JSON object. ' +
188+
'The response was valid JSON, but it was not a JSON object.',
189189
'jsonld.InvalidUrl', {code: 'invalid remote context', url});
190190
}
191191

0 commit comments

Comments
 (0)