Revision [1180]

Last edited on 2010-02-05 17:45:44 by DavidLee
Deletions:
q


Revision [816]

Edited on 2009-09-30 06:21:26 by DavidLee
Additions:
In order to raise an exception the throw command must be used
But this is not and will generate a syntax error
finally { command } ## SYNTAX ERROR HERE
Deletions:
But this is not
finally { command }
In order to raise an exception the throw command must be used


Revision [815]

Edited on 2009-09-30 06:20:32 by DavidLee
Additions:
For example this syntax is excepted
try
{ command ; }
catch X {
command ;
} finally
command;
But this is not
try { command ; } catch X { command ; }
finally { command }
q


Revision [814]

Edited on 2009-09-30 06:18:36 by DavidLee
Additions:
Example
echo Should Not happen
Result
command: not found
Error: Failed command
Completed block
Exceptions can be thrown out of functions, sub shells and sub scripts. Try/catch blocks can be nested both within the same shell and within sub shells and scripts. Within the catch block an exception can be rethrown or a new exception thrown. The finally block is executed whether or not an exception was caught. As in java, the finally clause (if present) is executed in each nested try/catch block if an exception is raised within the catch clause.
Deletions:
Examples
Exceptions can be thrown out of functions, sub shells and sub scripts. Try/catch blocks can be nested both within the same shell and within sub shells and scripts. Within the catch block an exception can be rethrown or a new exception thrown. As in java, the finally clause (if present) is executed in each nested try/catch block if an exception is raised within the catch clause.


Revision [813]

Edited on 2009-09-30 06:17:10 by DavidLee
Additions:
Exceptions can be thrown out of functions, sub shells and sub scripts. Try/catch blocks can be nested both within the same shell and within sub shells and scripts. Within the catch block an exception can be rethrown or a new exception thrown. As in java, the finally clause (if present) is executed in each nested try/catch block if an exception is raised within the catch clause.
Deletions:
Exceptions can be thrown out of functions, sub shells and sub scripts. Try/catch blocks can be nested both within the same shell and within sub shells and scripts. As in java, the finally clause (if present) is executed in each nested try/catch block if an exception is raised within the catch clause.


Revision [812]

Edited on 2009-09-30 06:16:11 by DavidLee
Additions:
} finally {
Results
Caught inner throw <fail>element</fail>
Finally inner block
Caught outer throw <fail>element</fail>
Finally outer block
Deletions:
finally {


Revision [811]

Edited on 2009-09-30 06:15:25 by DavidLee
Additions:
Exceptions can be thrown out of functions, sub shells and sub scripts. Try/catch blocks can be nested both within the same shell and within sub shells and scripts. As in java, the finally clause (if present) is executed in each nested try/catch block if an exception is raised within the catch clause.
try {
throw <[ <fail>element</fail> ]>
} catch E1 {
echo Caught inner throw $E1
throw $E1
} finally {
echo Finally inner block ;
}
} catch E2 {
echo Caught outer throw $E2;
finally {
echo Finally outer block ;


Revision [809]

Edited on 2009-09-30 06:11:03 by DavidLee
Additions:
CategoryCommands
Deletions:
[CategoryCommands]


Revision [808]

Edited on 2009-09-30 06:10:53 by DavidLee
Additions:
[CategoryCommands]
BasicSyntax
Deletions:
{BasicSyntax}


Revision [807]

The oldest known version of this page was created on 2009-09-30 06:10:31 by DavidLee
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki