Add error codes for IIIF errors
60: "Missing or invalid `size`." Without at least a size, no IIIF can be displayed. 61: "Cannot determine IIIF Image API version from provided image information JSON." Without finding out the version information, one could only guess how to use the image info JSON.
This commit is contained in:
@@ -89,10 +89,8 @@ function getComplianceLevelOfImageInfoForVersion(imageInfo, version) {
|
||||
&& typeof imageInfo.profile[0] === 'string') {
|
||||
return imageInfo.profile[0];
|
||||
}
|
||||
// TODO error: cannot get compliance level URL / string
|
||||
break;
|
||||
return;
|
||||
default:
|
||||
// TODO error: invalid Image API version
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,11 +109,10 @@ function getVersionOfImageInfo(imageInfo) {
|
||||
if (getComplianceLevelOfImageInfoForVersion(imageInfo, Versions.VERSION1)) {
|
||||
return Versions.VERSION1;
|
||||
}
|
||||
// TODO error: can't detect Image API version
|
||||
break;
|
||||
default:
|
||||
// TODO error: can't detect Image API version
|
||||
}
|
||||
assert(false, 61);
|
||||
}
|
||||
|
||||
function getLevelProfileForImageInfo(imageInfo) {
|
||||
|
||||
Reference in New Issue
Block a user