add log connect exprofile
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m5s

This commit is contained in:
Warunee Tamkoo 2026-07-21 09:15:02 +07:00
parent d10b7e11f0
commit d3e1707cc2

View file

@ -97,6 +97,8 @@ export class ExRetirementController extends Controller {
retryCount++; retryCount++;
continue; continue;
} }
// log error message
console.error('getData getOfficerRetireData error:', error);
throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "ไม่สามารถติดต่อ API ได้"); throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "ไม่สามารถติดต่อ API ได้");
} }
} }
@ -139,6 +141,7 @@ export class ExRetirementController extends Controller {
retryCount++; retryCount++;
continue; continue;
} }
console.error('getData document error:', error);
throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "ไม่สามารถติดต่อ API ได้"); throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "ไม่สามารถติดต่อ API ได้");
} }
} }
@ -168,6 +171,7 @@ async function getToken(ClientID: string, ClientSecret: string): Promise<string>
TokenCache.set(cacheKey, token); TokenCache.set(cacheKey, token);
return token; return token;
} catch (error) { } catch (error) {
console.error('getToken error:', error);
return Promise.reject({ message: "Error occurred", error }); return Promise.reject({ message: "Error occurred", error });
} }
} }
@ -251,6 +255,7 @@ export async function PostRetireToExprofile(
}); });
} }
console.error('importOfficerRetireData error', error);
throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "ไม่สามารถติดต่อ API ได้"); throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "ไม่สามารถติดต่อ API ได้");
} }
} }