Throw InternalServerException for null API response and specific error codes in employer and temporary client registration applications

This commit is contained in:
MahanCh
2025-09-08 13:01:55 +03:30
parent d780f24b36
commit 7ae7d8fc07
2 changed files with 11 additions and 3 deletions

View File

@@ -1334,9 +1334,13 @@ public class EmployerApplication : IEmployerApplication
if (!isMachMobilAndNationalCode.IsMatched)
return op.Failed("شماره همراه وارد شده با کد ملی مطابقت ندارد");
var apiRespons = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
if (apiRespons == null)
return op.Failed("خطا در سرویس احراز هویت");
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
if (apiRespons.ResponseContext.Status.Code ==14)
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
if (apiRespons.ResponseContext.Status.Code != 0)
return op.Failed($"{apiRespons.ResponseContext.Status.Message}");

View File

@@ -125,7 +125,11 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
var apiRespons = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
if (apiRespons == null)
return op.Failed("خطا در سرویس احراز هویت");
throw new InternalServerException("خطا در سرویس احراز هویت");
if (apiRespons.ResponseContext.Status.Code ==14)
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
if (apiRespons.ResponseContext.Status.Code != 0)
return op.Failed($"{apiRespons.ResponseContext.Status.Message}");