Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Error function
- function leoError(errorWhen,errorInfo)
- resetScreen()
- print("A fatal error occured when "..errorWhen)
- if errorInfo ~= "" then
- print (errorInfo)
- end
- end
- --Sample use
- if fs.exists(sFile) then
- local hRead = assert(fs.open(sFile, "r"))
- sTime = hRead.readLine()
- hRead.close()
- else
- leoError("trying to open alarmtime.txt","Please check if 'alarmtime.txt' in the folder of the file 'alarm' exists.")
- end
- --Output for user
- A fatal error occured when trying to open alarmtime.txt
- Please check if 'alarmime.txt' in the folde rof the file 'alarm' exists.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement