1. crash message in 4.0
- Posted by bernie Aug 17, 2008
- 926 views
If a user sets up a crash message and the system finds an error.
When the error is reported the error message points to crash message
routine in error.e and not to the actual error.
2. Re: crash message in 4.0
- Posted by mattlewis (admin) Aug 17, 2008
- 958 views
If a user sets up a crash message and the system finds an error.
When the error is reported the error message points to crash message
routine in error.e and not to the actual error.
Yes, that was the whole point of crash_message: to provide a more user friendly (or obfuscated) message to the end user.
Matt
3. Re: crash message in 4.0
- Posted by jeremy (admin) Aug 17, 2008
- 945 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
4. Re: crash message in 4.0
- Posted by bernie Aug 17, 2008
- 938 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...
5. Re: crash message in 4.0
- Posted by jeremy (admin) Aug 17, 2008
- 908 views
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 </eucode>
Yes. Were you expecting something else? Maybe you can do something like:
crash(sprintf("unknown instruction: %d", { op }))
Also, when you are formatting blocks of non-code on the wiki, you can use three left french brackets on it's own line, then your block of code, then three right french brackets. If you say Reply with Quote, you can see this formatting:
This is a block of something that needs to keep it's formatting exactly. Noticed I did not have to use any \\ or any other formatting.
Jeremy
6. Re: crash message in 4.0
- Posted by ne1uno Aug 17, 2008
- 944 views
?1/0 produces a full ex.err, crash() is limited since the actual crash is in error.e, which is just confusing. although you do get the message, you don't get your program and function state.
when translated, ?1/0 is confusing, you tried to divide by zero
while crash("error happened in xyz") makes more sense on the console and ex.err but when translated, of course, you get no program internal details.
unless I'm doing it wrong.
7. Re: crash message in 4.0
- Posted by mattlewis (admin) Aug 17, 2008
- 904 views
?1/0 produces a full ex.err, crash() is limited since the actual crash is in error.e, which is just confusing. although you do get the message, you don't get your program and function state.
when translated, ?1/0 is confusing, you tried to divide by zero
while crash("error happened in xyz") makes more sense on the console and ex.err but when translated, of course, you get no program internal details.
unless I'm doing it wrong.
Yes, the first thing reported is crash, since that's where it happened. But the rest of the stack trace is there. If this is still unacceptable, you can call machine_proc directly, without the std/error.e wrapper.
Matt
8. Re: crash message in 4.0
- Posted by ne1uno Aug 17, 2008
- 889 views
?1/0 produces a full ex.err, crash() is limited ... unless I'm doing it wrong.
Yes, the first thing reported is crash, since that's where it happened. But the rest of the stack trace is there.
yea, sorry. had too simple of a test program. the trace is there.
9. Re: crash message in 4.0
- Posted by jeremy (admin) Aug 17, 2008
- 899 views
Yes, the first thing reported is crash, since that's where it happened. But the rest of the stack trace is there. If this is still unacceptable, you can call machine_proc directly, without the std/error.e wrapper.
If we were to make crash() a true built-in, it should report the correct line for the first stack trace item, right?
Jeremy
10. Re: crash message in 4.0
- Posted by jimcbrown (admin) Aug 17, 2008
- 892 views
Yes, the first thing reported is crash, since that's where it happened. But the rest of the stack trace is there. If this is still unacceptable, you can call machine_proc directly, without the std/error.e wrapper.
If we were to make crash() a true built-in, it should report the correct line for the first stack trace item, right?
Jeremy
Yes, this would solve the issue quite elegantly.
11. Re: crash message in 4.0
- Posted by mattlewis (admin) Aug 17, 2008
- 932 views
Yes, the first thing reported is crash, since that's where it happened. But the rest of the stack trace is there. If this is still unacceptable, you can call machine_proc directly, without the std/error.e wrapper.
If we were to make crash() a true built-in, it should report the correct line for the first stack trace item, right?
Yep.
Matt