Took a better look at the docs and found an applicable solution:
\SetKwProg{Cmd}{block}{suffix}{end}
The suffix
and end
parts are optional
A minimum working example (MWE):
\usepackage[linesnumbered, ruled]{algorithm2e}
\begin{document}
\begin{algorithm}[t]
\SetKwInOut{Input}{Input}
\SetKwInOut{Output}{Output}
\SetKwProg{try}{try}{:}{}
\SetKwProg{catch}{catch}{:}{end}
\Input{Array $a$ and index $i$}
\Output{what the procedure returns}
\try{}{
$v \gets a[i]$
}
\catch{IndexOutOfBoundsException}{
$v \gets -1$
}
\Return $v$
\caption{Exception handling code}
\label{alg:exep}
\end{algorithm}
\end{document}
Output: