Re: crash message in 4.0
- Posted by bernie Aug 17, 2008
- 937 views
I am not sure what you are doing with crash message, but let's say you are removing and old ?1/0 type error to cause a crash...
if param = bad then puts(1, "bad parameter") ? 0/1 end if
You can now use crash() for that purpose and you will get your custom crash message and a full error report:
if param = bad then crash("parameter was bad") end if
This causes a full crash log with your error message, stack output, etc...
crash_message is designed for deployed applications to do something like:
Your program crashed. You should contact Bernie at 555-1212 for assistance or email to bernie@helpme.com. Please be sure to includ ex.err as an email attachment.
Jeremy
-- This is the section of code executing crash message op = opcodes[1] - OPERAND if op < 1 or op > length(table) then crash("unknown instruction") end if
D:\#eu40\INCLUDE\STD\error.e:51 in procedure crash()
unknown instruction
... called from C:\wmotor\include\motor.e:1165 in function asm()
... called from C:\wmotor\include\motor.e:1517 in function get_asm()
... called from C:\wmotor\include\motor.e:1895 in procedure Asm()
... called from C:\wmotor\include\motor.e:2724 in function strtok()
... called from C:\wmotor\include\motor.e:3506 in function struc_()
... called from C:\wmotor\include\motor.e:3650 in function struc()
... called from C:\wmotor\include\mtrwin.ew:48
> See ex.err
Press Enter...