diff --git a/apps/api/src/integrations/tahesab/tahesab-http.client.ts b/apps/api/src/integrations/tahesab/tahesab-http.client.ts index 72976bb..7c8d1c2 100644 --- a/apps/api/src/integrations/tahesab/tahesab-http.client.ts +++ b/apps/api/src/integrations/tahesab/tahesab-http.client.ts @@ -97,11 +97,23 @@ export class TahesabHttpClient { } } const status = res.statusCode ?? 0; + const detail = extractTahesabError(json, text); + const isEmptyOk = + Boolean(detail) && + Boolean(opts.emptyResultOnError) && + opts.emptyResultOnError!.test(detail); + if (status < 200 || status >= 300) { + if (isEmptyOk) { + this.logger.debug( + `Tahesab ${path} ${status} empty-on-error: ${detail.slice(0, 120)}`, + ); + resolve([] as T); + return; + } this.logger.warn( `Tahesab ${method} ${path} → ${status}: ${text.slice(0, 400)}`, ); - const detail = extractTahesabError(json, text); reject( new BadGatewayException( detail @@ -113,12 +125,7 @@ export class TahesabHttpClient { } // بعضی متدها با ۲۰۰ و فیلد ERROR برمی‌گردند if (json && typeof json === 'object' && 'ERROR' in (json as object)) { - const detail = extractTahesabError(json, text); - if ( - detail && - opts.emptyResultOnError && - opts.emptyResultOnError.test(detail) - ) { + if (isEmptyOk) { this.logger.debug( `Tahesab ${path} empty-on-error: ${detail.slice(0, 120)}`, ); diff --git a/apps/web/src/components/person-assets/PersonAssetsPanel.vue b/apps/web/src/components/person-assets/PersonAssetsPanel.vue index 959c5ac..16a6638 100644 --- a/apps/web/src/components/person-assets/PersonAssetsPanel.vue +++ b/apps/web/src/components/person-assets/PersonAssetsPanel.vue @@ -579,7 +579,9 @@ onMounted(async () => { -

سندی نیست.

+

+ در این بازه سندی یافت نشد. +