Skip to content

Added URL to context resolution error message. #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2 - xxxx-xx-xx

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

## 8.3.1 - 2023-09-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