Skip to content
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

no response in ui when manifest cannot be fetched #69

Closed
ConorSheehan1 opened this issue Dec 5, 2018 · 0 comments · Fixed by #70
Closed

no response in ui when manifest cannot be fetched #69

ConorSheehan1 opened this issue Dec 5, 2018 · 0 comments · Fixed by #70

Comments

@ConorSheehan1
Copy link
Contributor

While going through the iiif workshop on monday, I think I found a bug in the validator.
Submitting a manifest hosted locally using the URL format returns the correct error

https://iiif.io/api/presentation/validator/service/validate?format=json&version=2.0&url=http://127.0.0.1:8887/manifest.json

{"url": "http://127.0.0.1:8887/manifest.json", "okay": 0, "error": "Cannot fetch url"}

but submitting it using the UI, doesn't display any response, but throws an error in the console:

(index):152 Uncaught TypeError: Cannot read property 'length' of undefined
    at Object.handleValidationResponse [as success] ((index):152)
    at i (jquery-2.2.3.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-2.2.3.min.js:2)
    at z (jquery-2.2.3.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery-2.2.3.min.js:4)

The problem seems to be that data.warnings is undefined, so calling length on it throws an error.

if (data.warnings.length){

Maybe errors when fetching the resource could be added to warnings too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant