# # # # save_alert_message() # # # # include "templates.util.alert.alert_util"; # KHP 19/Mar/2012 - disabled because error messages are saved by C++ in logs.errors.error_messages.cfg #subroutine(save_alert_message( # string error_message, # string error_traceback), ( # # # Saves the error_message, error_traceback and error_info in files on disk and returns the error_id # # string error_id = md5_digest(now_us() . error_message . error_traceback); # # # # # # # handle error_message # # # # # # string message_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . error_id . "_error_message.txt"; # int message_handle = open_file(message_file, "w"); # write_string_to_file(message_handle, error_message); # close_file(message_handle); # # # # # # # handle error_traceback # # # # # # string traceback_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . error_id . "_error_traceback.txt"; # int traceback_handle = open_file(traceback_file, "w"); # write_string_to_file(traceback_handle, error_traceback); # close_file(traceback_handle); # # # # # # # # handle error_info # # # # # # # KHP 21/Sep/2011 - we want the error_info as node, hence we save it as node # # string error_info_text = get_error_info_text(); # # string info_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . error_id . "_error_info.txt"; # # int info_handle = open_file(info_file, "w"); # # write_string_to_file(info_handle, error_info_text); # # close_file(info_handle); # # node error_info = get_error_info(); # string error_info_path = "TemporaryFiles." . error_id . "_error_info"; # clone_node(error_info, error_info_path); # save_node(error_info_path); # # # # # # # # Return error_id # # # # # # error_id; #));