Jump to content




Crash Support?


  • You cannot reply to this topic
4 replies to this topic

#1 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 07 September 2013 - 11:51 PM

So, I am developing an OS with WolfNinja2, and I was wondering how FireWolf's crash screen worked, where it was put into a nice setup.

Could anyone help, just kinda list the basic functions needed?

I would like to make a Windows 8 Style blue screen. The big ":(" :D

Thanks in advance.
-deadmau5

#2 jay5476

  • Members
  • 289 posts

Posted 08 September 2013 - 12:43 AM

it uses pcall (protected call) and then displays it in a custom error format eg.
suc,err = pcall(print(var)) if not suc then print(err) end
that will show the error attempt to call number

#3 ebernerd

  • Members
  • 262 posts
  • LocationBoston, MA

Posted 08 September 2013 - 12:53 AM

View Postjay5476, on 08 September 2013 - 12:43 AM, said:

it uses pcall (protected call) and then displays it in a custom error format eg.
suc,err = pcall(print(var)) if not suc then print(err) end
that will show the error attempt to call number
And how do I implement this into a program? When do I use it?

#4 jay5476

  • Members
  • 289 posts

Posted 08 September 2013 - 01:09 AM

say in firewolf you acsess a site it sends you the code you do
suc, err = pcall(code)
if not suc then
print(err) -- or do stuff with the information
end


#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 08 September 2013 - 04:35 AM

Have a read of my tutorial.

it should also be noted on top of jay5476's code that you should do the following

local ok, err = pcall(shell.run, "someProgram")
if not ok and err ~= "Terminated" then
  print(err)
end
That way you're handling errors of a program, and also making sure you don't show the error screen if they terminated the program.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users