Commit 2cdd0d6d authored by Seemann Benjamin's avatar Seemann Benjamin

Imroved isURL error handling

parent ce546ed3
Pipeline #76696015 passed with stages
in 3 minutes and 29 seconds
......@@ -884,7 +884,6 @@ function getSourceAsDom(url) {
if (response.status === 200) {
return response.text();
}
console.log(response.status);
return null;
});
}
......@@ -927,13 +926,12 @@ export default async function isURL(url) {
if (fetched != null) {
output = handelSchemaOrg(fetched);
} else {
const seconedFetch = await getSourceAsDom(input);
if (seconedFetch != null) {
output = handelSchemaOrg(seconedFetch);
const secondFetch = await getSourceAsDom(input);
if (secondFetch != null) {
output = handelSchemaOrg(secondFetch);
} else {
output = 'No valid input';
}
alert('Fetching of Website failed please enter the Opening Hours Manually');
}
} else if (input.match(/[0-9]/g)) {
output = convert(input);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment