Re: Try/Catch

new topic     » goto parent     » topic index » view thread      » older message » newer message
katsmeow said...

May i request DCuny and other proponents of try/catch make a "project page" like Ryan suggested, with actual real life OE code which uses try/catch, with lots of what_ifs and whys and wherefores and pointers, showing just how this would work?

Kat

Ok, here's something to think about. Here are the possible causes of a fatal crash i could find from a quick search of source\execute.e. Which ones of these could be redesigned to not necessarily be fatal? Whether or not try/catch is the solution, i think we should discuss how we can find alternatives self-destructing in these situations. (Don't forget to think outside of the box for this!)

RTFatal( sprintf( "'%s' has not been assigned a value", {SymTab[sym][S_NAME]} ) ) 
RTFatal( sprintf("Unknown opcode: %d", op ) ) 
RTFatal("A subscript must be an atom") 
RTFatal("argument list must be a sequence") 
RTFatal("argument to getenv must be a sequence") 
RTFatal("attempt to divide by 0") 
RTFatal("attempt to exit a function without returning a value") 
RTFatal("attempt to slice an atom") 
RTFatal("attempt to subscript an atom\n(assigning to it)") 
RTFatal("attempt to subscript an atom\n(reading from it)") 
RTFatal("Can't get remainder of a number divided by 0") 
RTFatal("cleanup must be an atom") 
RTFatal("Couldn't open ctrace.out") 
RTFatal("crash routine requires a valid routine id") 
RTFatal("device or file name must be a sequence") 
RTFatal("first argument of match() must be a non-empty sequence") 
RTFatal("first argument of match() must be a sequence") 
RTFatal("first argument of match_from() must be a non-empty sequence") 
RTFatal("first argument of match_from() must be a sequence") 
RTFatal("first argument of system() must be a sequence") 
RTFatal("for-loop increment is not an atom") 
RTFatal("for-loop limit is not an atom") 
RTFatal("for-loop variable is not an atom") 
RTFatal("invalid open mode") 
RTFatal("invalid routine id") 
RTFatal("invalid task id") 
RTFatal("lengths do not match on assignment to slice") 
RTFatal("Maximum of 20 user defined delete routines exceeded.") 
RTFatal("min and max times must be atoms") 
RTFatal("min and max times must be greater than or equal to 0") 
RTFatal("no task to run") 
RTFatal("number of executions must be greater than 0") 
RTFatal("repetition count is too large") 
RTFatal("repetition count must be an atom") 
RTFatal("repetition count must not be negative") 
RTFatal("second argument must be {min-time, max-time}") 
RTFatal("second argument of find() must be a sequence") 
RTFatal("second argument of find_from() must be a sequence") 
RTFatal("second argument of match() must be a sequence") 
RTFatal("second argument of match_from() must be a sequence") 
RTFatal("second argument of system() must be an atom") 
RTFatal("slice ends past end of sequence") 
RTFatal("slice length is less than 0") 
RTFatal("slice lower index is less than 1") 
RTFatal("slice lower index is not an atom") 
RTFatal("slice starts past end of sequence") 
RTFatal("slice upper index is not an atom") 
RTFatal("specify the routine id of a procedure, not a function or type") 
RTFatal("subscript must be an atom") 
RTFatal("subscript must be an atom\n(assigning to subscript of a sequence)") 
RTFatal("subscript must be an atom\n(reading an element of a sequence)") 
RTFatal("task min time must be <= task max time") 
RTFatal("true/false condition must be an ATOM") 
RTFatal("variable " & SymTab[a][S_NAME] & " has not been assigned a value") 
RTFatal(sprintf("%s() does not return a value", SymTab[sub][S_NAME])) 
RTFatal(sprintf("call to %s() via routine-id should pass %d arguments, not %d", {SymTab[sub][S_NAME], SymTab[sub][S_NUM_ARGS], length(val[b])})) 
RTFatal(sprintf("index (%d) out of bounds in match_from()", c )) 
RTFatal(sprintf("slice upper index is less than 0 (%d)", upper ) ) 
RTFatal(sprintf("the value returned by %s() must be assigned or used", SymTab[sub][S_NAME])) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu