Bugfix für handle_exception() und Crons

This commit is contained in:
Andreas Bielawski
2016-08-24 15:54:16 +02:00
parent fb9d3652f3
commit 49dd18ce3f
2 changed files with 16 additions and 10 deletions

View File

@ -499,14 +499,20 @@ function utilities:resolve_username(input)
end
function utilities:handle_exception(err, message, log_chat)
if not err then err = '' end
local output = '\n[' .. os.date('%F %T', os.time()) .. ']\n' .. self.info.username .. ': ' .. err .. '\n' .. message .. '\n'
if log_chat then
output = '<code>' .. utilities.html_escape(output) .. '</code>'
return utilities.send_message(log_chat, output, true, nil, 'html')
else
print(output)
end
local output = string.format(
'[%s]\n%s: %s\n%s\n',
os.date('%F %T'),
self.info.username,
err or '',
message
)
if log_chat then
output = '<code>' .. utilities.html_escape(output) .. '</code>'
return utilities.send_message(log_chat, output, true, nil, 'html')
else
print(output)
end
end
-- MOVED TO DOWNLOAD_TO_FILE