Advertisement
Leo_Verto

LeoError 1.0

Mar 7th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. --Error function
  2. function leoError(errorWhen,errorInfo)
  3.     resetScreen()
  4.     print("A fatal error ocured when "..errorWhen)
  5.     if errorInfo ~= "" then
  6.         print (errorInfo)
  7.     end
  8. end
  9.  
  10. --Sample use
  11. if fs.exists(sFile) then
  12.         local hRead = assert(fs.open(sFile, "r"))
  13.         sTime = hRead.readLine()
  14.         hRead.close()
  15.     else
  16.         leoError("trying to open alarmtime.txt","Please check if 'alarmtime.txt' in the folder of the file 'alarm' exists.")
  17.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement