Smart pascal source code
Procedure ExceptionHandler;
Begin
// Outside re-raising
Raise ExceptObject; // User defined exception: Floating point division by zero
// but actually it is re-raised runtime-initiated exception
End;
Try
var x := 0;
var y := 5 div x;
Except
// Inside Re-rasing
// Raise; // Floating point division by zero
ExceptionHandler;
End;
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
Errors >>>>
Runtime Error: Division by zero [line: 5, column: 20]
[line: 19, column: 2]
Result >>>>
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}
function $Div(a,b) { var r=a/b; return (r>=0)?Math.floor(r):Math.ceil(r) }
function ExceptionHandler() {
throw ExceptObject();
};
var x$1 = 0,
y = 0;
/* <<< main JS >>> */
try {
x$1 = 0;
y = $Div(5,x$1);
} catch ($e) {
ExceptionHandler();
}