Improve error messaging for Gitea access issues

- Add more descriptive error messages for Gitea server access problems
- Indicate potential causes: private repository or server configuration
- Help users understand why online template updates may not work
- Maintain functionality with local fallback
This commit is contained in:
Frank Cools 2025-10-07 20:26:01 +02:00
parent abd4156a88
commit e2cf7bfe9b

View File

@ -1543,7 +1543,7 @@ class DeclarationTVA_PDF
if (file_exists($local_manifest)) {
$manifest_content = file_get_contents($local_manifest);
// Set a note that we're using local manifest
$update_info['error'] = 'Using local manifest (Gitea server not accessible)';
$update_info['error'] = 'Using local manifest (Gitea server not accessible - repository may be private or server configuration issue)';
}
if ($manifest_content === false) {
$update_info['error'] = 'Failed to fetch manifest from Gitea and local file not found';
@ -1603,7 +1603,7 @@ class DeclarationTVA_PDF
if (file_exists($local_template)) {
$template_content = file_get_contents($local_template);
// Note that we're using local template
$this->error = 'Using local template (Gitea server not accessible)';
$this->error = 'Using local template (Gitea server not accessible - repository may be private or server configuration issue)';
}
if ($template_content === false) {
$this->error = 'Failed to download template from Gitea and local file not found';