refactor(mikrotikBackupRoutes, mikrotikApplyService): improve error handling and logging for backup and file retrieval processes
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 3m2s

This commit is contained in:
2026-02-10 01:48:07 +07:00
parent db31690df5
commit 77ba6c1fa3
2 changed files with 61 additions and 42 deletions
+10 -3
View File
@@ -280,9 +280,16 @@ async function runBackupNow(req, res) {
s3,
});
} catch (error) {
console.error('runBackupNow error:', error);
const msg = error?.message || 'Error running backup now';
return sendError(res, 500, msg, 'E_BACKUP_RUN');
console.error('runBackupNow error:', error?.message, error?.stack, error?.response?.data);
let msg = error?.message || 'Error running backup now';
const detail = error?.response?.data;
if (detail && typeof detail === 'object') {
const d = detail.detail || detail.message;
if (d) msg += ` (${d})`;
} else if (typeof detail === 'string') {
msg += ` (${detail})`;
}
return sendError(res, 500, msg, 'E_BACKUP_RUN', process.env.NODE_ENV !== 'production' ? { stack: error?.stack } : undefined);
}
}