Instead of trying to cast the SPPrincipal to SPUser / SPGroup (like SPUser oRoleUser = (SPUser)oPrincipal) within a try / catch block I suggest you to simply check the object type (like if (oPrincipal is SPUser)). It results in a clearer code and better performance as well.