Trying to track down a bug that is happening when run in Docker. Pretty sure it is related to a DNS resolution thing. The GET Object function shows better information if something goes wrong.

This commit is contained in:
Scott Idem
2025-01-06 16:24:47 -05:00
parent b64e7a6b8a
commit 92af1a5962
4 changed files with 596 additions and 530 deletions

View File

@@ -56,7 +56,7 @@ let ae_loc_init: key_val = {
// properties: params, route, url
// functions: fetch, setHeaders, parent, depends, untrack
export async function load({ fetch, params, parent, route, url }) { // params, route, url
let log_lvl: number = 0;
let log_lvl: number = 2;
// console.log(`Svelte root +layout.ts params:`, params);
// console.log(`Svelte root +layout.ts route:`, route);
// console.log(`Svelte root +layout.ts url:`, url);
@@ -134,6 +134,7 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
account_id = await core_func.handle_load_ae_obj_id__site_domain({
api_cfg: ae_api_init,
// fqdn: 'idaa.localhost:5173', // url.host,
fqdn: url.host,
try_cache: false,
log_lvl: log_lvl
@@ -203,20 +204,32 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
return site_domain_results.account_id_random;
}
console.log(`root +layout.ts: Site domain results not found!!!`)
console.log(`root +layout.ts: Site domain results not found!!! URL = `, url);
return null; // For no results
return null;
})
.catch(function (error) {
console.log(`root +layout.ts: Site domain lookup error = `, error);
// error(500, {
// message: 'Site lookup failed!'
// });
return false; // For a likely API or DB connection error
});
if (!account_id) {
if (await account_id === null) {
console.log(`root +layout.ts: The account_id was not found in API response!!!`);
// return false;
// return;
error(500, {
message: 'Account ID not found'
message: 'The account ID was not found!'
});
} else if (await account_id === false) {
console.log(`root +layout.ts: The API site lookup may have failed!!!`);
error(500, {
message: 'Site lookup failed! Check the API.'
});
}
// console.log(ae_loc_init);
ae_acct['api'] = ae_api_init;
ae_acct['loc'] = ae_loc_init;