Deletions:
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
But this is not and will generate a syntax error
finally { command } ## SYNTAX ERROR HERE
Deletions:
finally { command }
In order to raise an exception the throw command must be used
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
try
{ command ; }
catch X {
command ;
} finally
command;
But this is not
try { command ; } catch X { command ; }
finally { command }
q
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.
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:
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.
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:
Additions:
} finally {
Results
Caught inner throw <fail>element</fail>
Finally inner block
Caught outer throw <fail>element</fail>
Finally outer block
Results
Caught inner throw <fail>element</fail>
Finally inner block
Caught outer throw <fail>element</fail>
Finally outer block
Deletions:
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 ;
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 ;
Additions:
CategoryCommands
Deletions:
Additions:
[CategoryCommands]
BasicSyntax
BasicSyntax