23 posts
Location
United States, USA
Posted 08 April 2017 - 09:08 PM
I was wondering how i can make an error message without the line number or file name. This is kind of annoying as i am working with my OS. All i just want is Failed with no line number or file name. Pastebin is in my Signature.
1426 posts
Location
Does anyone put something serious here?
Posted 08 April 2017 - 09:18 PM
You've got two options:
If you just want to print an error message, but not exit then
printError is your best bet. This prints some red text (if your computer supports colour) and continues.
printError("Woops.") -- Displays "Woops."
print("Will still be executed")
If you want to actually produce an error, then you can pass 0 as the second argument to
error. This will mean no file/line information is included.
error("Woops.", 0) -- Displays "Woops." and exists.
print("Will not be executed").
41 posts
Location
Everywhere
Posted 08 April 2017 - 09:19 PM
You want to use error()
error("Failed",0)
Edited on 08 April 2017 - 07:22 PM