Update README and enhance error handling: Increment version to 2.4 Build 4 and add notes on PHP version management. Improve error logging across multiple modules by replacing BaseException with Exception and utilizing secure error handling methods. Ensure consistent error responses in API and middleware functions for better debugging and user feedback.

This commit is contained in:
Master3395
2025-09-21 20:36:12 +02:00
parent 0161aba5f5
commit 48c9c1ad6a
8 changed files with 500 additions and 157 deletions

View File

@@ -2,6 +2,7 @@
import os.path
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
from plogical.errorSanitizer import secure_error_response, secure_log_error
from django.shortcuts import HttpResponse, render
import json
import re
@@ -244,9 +245,9 @@ class secMiddleware:
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
except BaseException as msg:
final_dic = {'error_message': f"Error: {str(msg)}",
"errorMessage": f"Error: {str(msg)}"}
except Exception as e:
secure_log_error(e, 'secMiddleware_body_validation')
final_dic = secure_error_response(e, 'Request validation failed')
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
else: