Skip to content

Commit edcfd03

Browse files
committed
added 404 error handling
1 parent 6be0697 commit edcfd03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/biorepo_components/BiorepoPage.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ export default function BiorepoPage() {
2424
const candidatePath = `/${pathSegments.slice(0, i).join('/')}/neon-react`;
2525
// Check if the resource exists (use HEAD request to test for existence)
2626
const xhr = new XMLHttpRequest();
27-
xhr.open('HEAD', `${basePath}${candidatePath}`, false);
27+
xhr.open('HEAD', `${basePath}${candidatePath}/biorepo_lib/getSymbiniConfig.php`, false);
2828
xhr.send();
2929
if (xhr.status === 200) {
3030
clientRootPath = `/${pathSegments.slice(0, i).join('/')}`;
3131
break;
32+
} else if (xhr.status === 404) {
33+
// pass
3234
}
3335
}
3436
const fetchUrl = `${basePath}${clientRootPath}/neon-react/biorepo_lib/getSymbiniConfig.php`;

0 commit comments

Comments
 (0)