function tryexpt

try
    main
catch e
    ShowCursor
    Screen('CloseAll');
    rethrow(e);
end