Skip to content

Commit

Permalink
Added URL to context resolution error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianorwhatever authored and davidlehn committed Dec 21, 2024
1 parent 5367858 commit d8696b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# jsonld ChangeLog

## 8.3.3 - xxxx-xx-xx

### Added
- Added URL to context resolution error message.

## 8.3.2 - 2023-12-06

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions lib/ContextResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ module.exports = class ContextResolver {
}
} catch(e) {
throw new JsonLdError(
'Dereferencing a URL did not result in a valid JSON-LD object. ' +
'Possible causes are an inaccessible URL perhaps due to ' +
'Dereferencing the URL ' + url + ' did not result in a valid JSON-LD ' +
'object. Possible causes are an inaccessible URL perhaps due to ' +
'a same-origin policy (ensure the server uses CORS if you are ' +
'using client-side JavaScript), too many redirects, a ' +
'non-JSON response, or more than one HTTP Link Header was ' +
Expand All @@ -184,8 +184,8 @@ module.exports = class ContextResolver {
// ensure ctx is an object
if(!_isObject(context)) {
throw new JsonLdError(
'Dereferencing a URL did not result in a JSON object. The ' +
'response was valid JSON, but it was not a JSON object.',
'Dereferencing the URL ' + url + ' did not result in a JSON object. ' +
'The response was valid JSON, but it was not a JSON object.',
'jsonld.InvalidUrl', {code: 'invalid remote context', url});
}

Expand Down

0 comments on commit d8696b6

Please sign in to comment.