mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user