Skip to content

no response in ui when manifest cannot be fetched #69

@ConorSheehan1

Description

@ConorSheehan1

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions